-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-33261: guard access to __code__ attribute in inspect #6448
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
Conversation
An alternative solution, closer to the original code, would be def _have_code_flag(func, flag):
"""Return true if the function ``func`` has a code object with
``flag`` in its flags."""
if ismethod(func):
func = func.__func__
return isfunction(func) and bool(code.co_flags & flag) |
The
I don't think the PR as it is (i.e. checking for So I'm leaning towards the alternative solution, keeping the |
0d704d8
to
b04a213
Compare
I updated the branch with explit |
Branch rebased to latest master. Please review... |
CC @1st1 as suggested by https://devguide.python.org/experts/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with this implementation.
So, are you willing to actually merge it (or add the automerge label)? |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. |
https://bugs.python.org/issue33261