aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2021-06-13 15:38:40 -0700
committerZac Medico <zmedico@gentoo.org>2021-06-13 15:41:06 -0700
commit482079c7835c769843544a4920ccb4c49d363351 (patch)
treec4bfa9571a946691d47d8d45035c35c88451bdeb /lib
parentUpdates for portage-3.0.20 release (diff)
downloadportage-482079c7835c769843544a4920ccb4c49d363351.tar.gz
portage-482079c7835c769843544a4920ccb4c49d363351.tar.bz2
portage-482079c7835c769843544a4920ccb4c49d363351.zip
PORTAGE_NICENESS: fix atexit ResourceWarning: unclosed file
# emerge -V Portage 3.0.20 (python 3.8.5-final-0, default/linux/amd64/17.1/desktop, gcc-9.3.0, glibc-2.31-r6, 5.4.x x86_64) /usr/lib/python3.8/site-packages/_emerge/actions.py:2663: ResourceWarning: unclosed file <_io.TextIOWrapper name='/proc/self/autogroup' mode='w' encoding='UTF-8'> lambda value: autogroup_file.open("w").write(value).close(), ResourceWarning: Enable tracemalloc to get the object allocation traceback Fixes: a4d882964ee1 ("PORTAGE_NICENESS: Consider autogroup scheduling") Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/_emerge/actions.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 18f8da200..bfb08ed6b 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -2660,7 +2660,7 @@ def nice(settings):
# terminal where portage was executed in, would
# continue running with that value.
portage.atexit_register(
- lambda value: autogroup_file.open("w").write(value),
+ lambda value: autogroup_file.write_text(value),
original_autogroup_nice_value,
)