From: Zac Medico Date: Sun, 28 Aug 2011 21:04:41 +0000 (-0700) Subject: Fix possible NameError in finally block. X-Git-Tag: v2.2.0_alpha52~46 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=566a9776d3ca10ccf1b646fba154fa71ccaf4ff6;p=portage.git Fix possible NameError in finally block. --- 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))