Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py

Patch by Madison May.
This commit is contained in:
Berker Peksag 2016-09-26 23:06:32 +03:00
parent 6129e14b21
commit 8b6b50814e
2 changed files with 6 additions and 2 deletions

View File

@ -135,10 +135,11 @@ def framework_find(fn, executable_path=None, env=None):
Python.framework Python.framework
Python.framework/Versions/Current Python.framework/Versions/Current
""" """
error = None
try: try:
return dyld_find(fn, executable_path=executable_path, env=env) return dyld_find(fn, executable_path=executable_path, env=env)
except ValueError as e: except ValueError as e:
pass error = e
fmwk_index = fn.rfind('.framework') fmwk_index = fn.rfind('.framework')
if fmwk_index == -1: if fmwk_index == -1:
fmwk_index = len(fn) fmwk_index = len(fn)
@ -147,7 +148,7 @@ def framework_find(fn, executable_path=None, env=None):
try: try:
return dyld_find(fn, executable_path=executable_path, env=env) return dyld_find(fn, executable_path=executable_path, env=env)
except ValueError: except ValueError:
raise e raise error
def test_dyld_find(): def test_dyld_find():
env = {} env = {}

View File

@ -80,6 +80,9 @@ Core and Builtins
Library 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 #27611: Fixed support of default root window in the tkinter.tix module.
- Issue #27348: In the traceback module, restore the formatting of exception - Issue #27348: In the traceback module, restore the formatting of exception