summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-08-28 14:04:41 -0700
committerZac Medico <zmedico@gentoo.org>2011-08-28 14:04:41 -0700
commit566a9776d3ca10ccf1b646fba154fa71ccaf4ff6 (patch)
treea29d6bd94bf6a5312de13f2466823badc402b72f
parent4afee825db23000b28a226b7b488956d4eb8f708 (diff)
downloadportage-566a9776d3ca10ccf1b646fba154fa71ccaf4ff6.tar.gz
portage-566a9776d3ca10ccf1b646fba154fa71ccaf4ff6.tar.bz2
portage-566a9776d3ca10ccf1b646fba154fa71ccaf4ff6.zip
Fix possible NameError in finally block.
-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))