diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-04 20:33:33 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-04 20:33:33 +0300 |
| commit | 64c26e5f6004523090c52970d1ed31a351617f38 (patch) | |
| tree | 1fb3d95f1e3a6b1164a2458b2e95b2a56eef4bca /Lib/test/test_sys_settrace.py | |
| parent | a5071c2b4cff9c51fc0fd106a3d42b9a2563eb91 (diff) | |
| parent | 64a263a1ceed726494767d833a2ea33033a6ae28 (diff) | |
| download | cpython-git-64c26e5f6004523090c52970d1ed31a351617f38.tar.gz | |
Issue #20041: Fixed TypeError when frame.f_trace is set to None.
Patch by Xavier de Gaye.
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
| -rw-r--r-- | Lib/test/test_sys_settrace.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index bb836233e1..25c5835fd6 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -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): |
