File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ ClassMethod PyStartWithScope(pCoverageClasses As %List) [ Language = python ]
76
76
# extracts frame code
77
77
code = frame .f _code
78
78
# extracts calling function name and the class that the function is in
79
- class _name = frame .f _globals [ '__name __']
79
+ class _name = frame .f _globals . get ( '__name __', None ) # Use get to avoid KeyError
80
80
# extracts the line number
81
81
line _no = frame .f _lineno
82
- if class _name in tCoverageClasses and line _no > 1 : # if this is in a covered class
82
+ if class _name and class _ name in tCoverageClasses and line _no > 1 : # if this is in a covered class
83
83
tGlob = iris .gref ('^IRIS .Temp .TestCoveragePY ') # python doesn 't have macros -- this is $$$PyMonitorResults
84
84
# $$$PyMonitorResults(classname , linenumber ) = the number of times that linenumber in that class was covered
85
85
You can’t perform that action at this time.
0 commit comments