diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-09-24 18:14:18 +0000 |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-09-24 18:14:18 +0000 |
commit | 517185edcb252bd85c83d96480bf79b85258e1f2 (patch) | |
tree | 88dd6969532abb42f232e15d7ee4ccef46c51b5e /Lib/trace.py | |
parent | 2c7d6859a42634921b2bb2447dfa890633db4d05 (diff) | |
download | cpython-git-517185edcb252bd85c83d96480bf79b85258e1f2.tar.gz |
Merged revisions 84994 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84994 | alexander.belopolsky | 2010-09-24 14:03:12 -0400 (Fri, 24 Sep 2010) | 1 line
Issue #9936: Fixed executable lines' search in the trace module.
........
Diffstat (limited to 'Lib/trace.py')
-rw-r--r-- | Lib/trace.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/trace.py b/Lib/trace.py index 7ec0cf6bc6..12e1b49207 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -58,7 +58,7 @@ import token import tokenize import inspect import gc - +import dis try: import cPickle pickle = cPickle @@ -379,13 +379,7 @@ def find_lines_from_code(code, strs): """Return dict where keys are lines in the line number table.""" linenos = {} - line_increments = [ord(c) for c in code.co_lnotab[1::2]] - table_length = len(line_increments) - docstring = False - - lineno = code.co_firstlineno - for li in line_increments: - lineno += li + for _, lineno in dis.findlinestarts(code): if lineno not in strs: linenos[lineno] = 1 |