-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-29235: Make cProfile.Profile a context manager. #6808
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
bpo-29235: Make cProfile.Profile a context manager. #6808
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request Thanks again to your contribution and we look forward to looking at it! |
I believe I've signed the CLA now. |
@ssanderson thanks for the CLA but the validation is manual. we have to wait for the notification in the bug tracker :/ sorry, maybe @brettcannon could remove the CLA not signed, but you need to prove it. thanks again for your PR. |
Ah, I see, I missed the note in the devguide saying to wait a day. Thanks for the heads up @matrixise! |
0a22589
to
6605cf5
Compare
@ssanderson Thanks for you PR. The changeset is missing a news entry. Please follow https://devguide.python.org/committing/#what-s-new-and-news-entries and add a blurb. |
@tiran updated with a news entry! |
Add `__enter__` and `__exit__` methods to `cProfile.Profiler` that call `enable()` and `disable()`, respectively.
bde4930
to
e4263ae
Compare
The travis failure here is in
|
The PR looks great, so I've just kicked off Travis again just to be safe/paranoid about the failure (but even if it fails again, @ssanderson , just ping this PR once Travis is finished so we don't forget to merge). |
@brettcannon looks like travis is happy now. |
(I noticed a small typo in the NEWS entry when looking at this again though). |
I think this is good to merge. Anything else that's needed from me here? |
Thanks for the patch, @ssanderson ! (And sorry for the delayed response; PyCon US recovery 😉 ) |
@brettcannon thanks for merging! |
Add
__enter__
and__exit__
methods tocProfile.Profile
that callenable()
anddisable()
, respectively.https://bugs.python.org/issue29235