summaryrefslogtreecommitdiff
path: root/coverage/pytracer.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-03-14 13:40:14 -0400
committerNed Batchelder <ned@nedbatchelder.com>2017-03-14 13:40:14 -0400
commit50a3baf54146337172d5efc57933adceb2b2fb78 (patch)
tree8ca9cee690bcbffd0c29f9b6978490dbda07589b /coverage/pytracer.py
parentde73882e515fcce4bc4f2c62f0a6de42178866a5 (diff)
downloadpython-coveragepy-50a3baf54146337172d5efc57933adceb2b2fb78.tar.gz
Minimal IronPython support.
IronPython is weird: 2.7.7 has "str is unicode", and unicode.encode produces unicode! f_lasti is missing, and frame globals are missing.
Diffstat (limited to 'coverage/pytracer.py')
-rw-r--r--coverage/pytracer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/pytracer.py b/coverage/pytracer.py
index 3cf956f..6dae014 100644
--- a/coverage/pytracer.py
+++ b/coverage/pytracer.py
@@ -101,7 +101,7 @@ class PyTracer(object):
# function calls and re-entering generators. The f_lasti field is
# -1 for calls, and a real offset for generators. Use <0 as the
# line number for calls, and the real line number for generators.
- if frame.f_lasti < 0:
+ if getattr(frame, 'f_lasti', -1) < 0:
self.last_line = -frame.f_code.co_firstlineno
else:
self.last_line = frame.f_lineno