File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ Unreleased
62
62
- We no longer ship a PyPy-specific wheel. PyPy will install the pure-Python
63
63
wheel. Closes `issue 2001 `_.
64
64
65
+ - In the very unusual situation of not having a current frame, coverage no
66
+ longer crashes when using the sysmon core, fixing `issue 2005 `_.
67
+
65
68
.. _issue 310 : https://github.com/nedbat/coveragepy/issues/310
66
69
.. _issue 312 : https://github.com/nedbat/coveragepy/issues/312
67
70
.. _issue 367 : https://github.com/nedbat/coveragepy/issues/367
@@ -73,7 +76,7 @@ Unreleased
73
76
.. _issue 1941 : https://github.com/nedbat/coveragepy/issues/1941
74
77
.. _pull 1998 : https://github.com/nedbat/coveragepy/pull/1998
75
78
.. _issue 2001 : https://github.com/nedbat/coveragepy/issues/2001
76
-
79
+ .. _ issue 2005 : https://github.com/nedbat/coveragepy/issues/2005
77
80
78
81
.. start-releases
79
82
Original file line number Diff line number Diff line change @@ -318,10 +318,12 @@ def sysmon_py_start(
318
318
filename = code .co_filename
319
319
disp = self .should_trace_cache .get (filename )
320
320
if disp is None :
321
- frame = inspect .currentframe ().f_back # type: ignore[union-attr]
322
- if LOG :
323
- # @panopticon adds a frame.
324
- frame = frame .f_back # type: ignore[union-attr]
321
+ frame = inspect .currentframe ()
322
+ if frame is not None :
323
+ frame = inspect .currentframe ().f_back # type: ignore[union-attr]
324
+ if LOG :
325
+ # @panopticon adds a frame.
326
+ frame = frame .f_back # type: ignore[union-attr]
325
327
disp = self .should_trace (filename , frame ) # type: ignore[arg-type]
326
328
self .should_trace_cache [filename ] = disp
327
329
You can’t perform that action at this time.
0 commit comments