summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/doebuild.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 47b4ec400..c252e86a3 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1691,6 +1691,7 @@ def _post_src_install_soname_symlinks(mysettings, out):
needed_filename = os.path.join(mysettings["PORTAGE_BUILDDIR"],
"build-info", "NEEDED.ELF.2")
+ f = None
try:
f = io.open(_unicode_encode(needed_filename,
encoding=_encodings['fs'], errors='strict'),
@@ -1702,7 +1703,8 @@ def _post_src_install_soname_symlinks(mysettings, out):
raise
return
finally:
- f.close()
+ if f is not None:
+ f.close()
libpaths = set(portage.util.getlibpaths(
mysettings["ROOT"], env=mysettings))