From: Zac Medico Date: Tue, 3 Apr 2012 15:38:13 +0000 (-0700) Subject: _check_temp_dir: explicitly close temp file X-Git-Tag: v2.2.0_alpha100~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=318893ddf8cdcf778e7ba6a49f3ad062af19bdf9;p=portage.git _check_temp_dir: explicitly close temp file --- diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 49672e107..29bef0917 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1152,8 +1152,7 @@ def _check_temp_dir(settings): noiselevel=-1) return 1 - else: - fd = tempfile.NamedTemporaryFile(prefix="exectest-", dir=checkdir) + with tempfile.NamedTemporaryFile(prefix="exectest-", dir=checkdir) as fd: os.chmod(fd.name, 0o755) if not os.access(fd.name, os.X_OK): writemsg(_("Can not execute files in %s\n"