]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py
authorBerker Peksag <berker.peksag@gmail.com>
Mon, 26 Sep 2016 20:06:32 +0000 (23:06 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Mon, 26 Sep 2016 20:06:32 +0000 (23:06 +0300)
Patch by Madison May.

Lib/ctypes/macholib/dyld.py
Misc/NEWS

index dc7052e747019fe62406d7755d2cb702628ac178..c158e672f0511ab0f7b125937330be20c1a7c4ba 100644 (file)
@@ -135,10 +135,11 @@ def framework_find(fn, executable_path=None, env=None):
         Python.framework
         Python.framework/Versions/Current
     """
+    error = None
     try:
         return dyld_find(fn, executable_path=executable_path, env=env)
     except ValueError as e:
-        pass
+        error = e
     fmwk_index = fn.rfind('.framework')
     if fmwk_index == -1:
         fmwk_index = len(fn)
@@ -147,7 +148,7 @@ def framework_find(fn, executable_path=None, env=None):
     try:
         return dyld_find(fn, executable_path=executable_path, env=env)
     except ValueError:
-        raise e
+        raise error
 
 def test_dyld_find():
     env = {}
index 2ec7c9d477c9b9a73407259f728a775d6a989b7f..84455c070a57116136e1465bf89dd7bf3da546d9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -80,6 +80,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
+  Patch by Madison May.
+
 - Issue #27611: Fixed support of default root window in the tkinter.tix module.
 
 - Issue #27348: In the traceback module, restore the formatting of exception