FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-153068: Preserve cprofile enable errors by aisk · Pull Request #153070 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .py  (1) .rst  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 3 additions & 2 deletions Lib/test/test_profiling/test_tracing_profiler.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def test_second_profiler(self):
pr = self.profilerclass()
pr2 = self.profilerclass()
pr.enable()
self.assertRaises(ValueError, pr2.enable)
pr.disable()
self.addCleanup(pr.disable)
msg = f"tool {sys.monitoring.PROFILER_ID} is already in use"
self.assertRaisesRegex(ValueError, msg, pr2.enable)

def test_throw(self):
"""
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix :meth:`!cProfile.Profile.enable` to no longer overwrite errors from
:mod:`sys.monitoring`.
1 change: 0 additions & 1 deletion Modules/_lsprof.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ _lsprof_Profiler_enable_impl(ProfilerObject *self, int subcalls,
"use_tool_id", "is",
self->tool_id, "cProfile");
if (check == NULL) {
PyErr_Format(PyExc_ValueError, "Another profiling tool is already active");
goto error;
}
Py_DECREF(check);
Expand Down
Loading

Back | FazBrowse Home | New Git URL