-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-132250: Clear error in lsprof callback when method descriptor raises an excep… #132251
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
Hi @sobolevn , I think we've been working on |
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.
Thanks! Mostly looks good :)
Misc/NEWS.d/next/Library/2025-04-08-01-55-11.gh-issue-132250.APBFCw.rst
Outdated
Show resolved
Hide resolved
Lib/test/test_cprofile.py
Outdated
self.assertEqual(nc, 1) | ||
|
||
def test_bad_descriptor(self): | ||
""" |
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 know that this is used above, but I am not a fan of docstrings in unittests :( Docstrings can be shown during test execution.
Let's maybe convert it to comments?
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 don't have problem converting it to comments, but it seems to be pretty random if we do it case by case. I think we have plenty of docstrings in our test suite. I always use python -m test
for stdlib tests so the docstring never bothers me. Do you use unittest
directly for these tests? If we want to even soft-enforce this, we should probably discuss it among some core devs and put it somewhere in the devguide. Most people won't be able to see it, but we can refer to it during code reviews and we can gradually make it happen.
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.
Okay I converted this to a comment - I don't have a strong opinion on this (it's easier to do a docstring if the description is long so I normally just do a docstring). If you believe this actually matters in some cases, we should probably discuss it and put it to somewhere in devguide. It would be helpful for people like us to make a decision and get use to it :)
…PBFCw.rst Co-authored-by: sobolevn <mail@sobolevn.me>
Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…r raises an excep… (pythonGH-132251) (cherry picked from commit ab64130) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
GH-132281 is a backport of this pull request to the 3.13 branch. |
…r raises an excep… (python#132251)
…tion
_ccall_callback
method of_lsprof.Profiler
causes Fatal Python error #132250