Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b6b508

Browse files
committed
Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py
Patch by Madison May.
1 parent 6129e14 commit 8b6b508

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/ctypes/macholib/dyld.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ def framework_find(fn, executable_path=None, env=None):
135135
Python.framework
136136
Python.framework/Versions/Current
137137
"""
138+
error = None
138139
try:
139140
return dyld_find(fn, executable_path=executable_path, env=env)
140141
except ValueError as e:
141-
pass
142+
error = e
142143
fmwk_index = fn.rfind('.framework')
143144
if fmwk_index == -1:
144145
fmwk_index = len(fn)
@@ -147,7 +148,7 @@ def framework_find(fn, executable_path=None, env=None):
147148
try:
148149
return dyld_find(fn, executable_path=executable_path, env=env)
149150
except ValueError:
150-
raise e
151+
raise error
151152

152153
def test_dyld_find():
153154
env = {}

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Core and Builtins
8080
Library
8181
-------
8282

83+
- Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
84+
Patch by Madison May.
85+
8386
- Issue #27611: Fixed support of default root window in the tkinter.tix module.
8487

8588
- Issue #27348: In the traceback module, restore the formatting of exception

0 commit comments

Comments
 (0)