mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-132250: Clear error in lsprof callback when method descriptor raises an excep… (#132251)
This commit is contained in:
parent
efd8aca62c
commit
ab64130b57
3 changed files with 10 additions and 0 deletions
|
@ -139,6 +139,14 @@ class CProfileTest(ProfileTest):
|
|||
self.assertEqual(cc, 1)
|
||||
self.assertEqual(nc, 1)
|
||||
|
||||
def test_bad_descriptor(self):
|
||||
# gh-132250
|
||||
# cProfile should not crash when the profiler callback fails to locate
|
||||
# the actual function of a method.
|
||||
with self.profilerclass() as prof:
|
||||
with self.assertRaises(TypeError):
|
||||
bytes.find(str())
|
||||
|
||||
|
||||
class TestCommandLine(unittest.TestCase):
|
||||
def test_sort(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue