mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #20041: Fixed TypeError when frame.f_trace is set to None.
Patch by Xavier de Gaye.
This commit is contained in:
commit
64c26e5f60
3 changed files with 14 additions and 0 deletions
|
@ -388,6 +388,15 @@ class TraceTestCase(unittest.TestCase):
|
|||
(257, 'line'),
|
||||
(257, 'return')])
|
||||
|
||||
def test_17_none_f_trace(self):
|
||||
# Issue 20041: fix TypeError when f_trace is set to None.
|
||||
def func():
|
||||
sys._getframe().f_trace = None
|
||||
lineno = 2
|
||||
self.run_and_compare(func,
|
||||
[(0, 'call'),
|
||||
(1, 'line')])
|
||||
|
||||
|
||||
class RaisingTraceFuncTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue