New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalid exception handling in Lib/ctypes/macholib/dyld.py #63093
Comments
The exception handling clauses in framework_find() are weird. def framework_find(fn, executable_path=None, env=None):
"""
Find a framework using dyld semantics in a very loose manner.
My guess is that this is left-over code from Py2.x. Since it doesn't make sense to catch an exception in the second clause just to re-raise it, I think the intention was really to re-raise the original exception caught in the first clause, which no longer works that way in Py3. The fix would then be to assign the exception to a new variable in the first except clause and re-raise that in the second. I found this problem because Cython rejected the module with a compile error about "e" being undefined in the last line. |
changing title as it doesn't really look like a typo, more a "converto" |
Your analysis looks correct to me, that is "raise e" is supposed to raise the exception caught by the first try block. |
Seems like a simple fix -- patch attached. |
lgtm |
New changeset e9f34d382eda by Berker Peksag in branch '3.5': New changeset 708337cd8e6a by Berker Peksag in branch '3.6': New changeset b9d9c49d5b50 by Berker Peksag in branch 'default': |
Thanks! |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: