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
commit13ed869c6be652f0b7729cebb26583d03c7ab12a (patch)
tree4081c110d336d83ccb0f2d83c004a249a46e3c3f /coverage/pytracer.py
parente626cb5cf730217fbedc3d06b80215c09bbe7013 (diff)
downloadpython-coveragepy-git-13ed869c6be652f0b7729cebb26583d03c7ab12a.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 3cf956fd..6dae0148 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