summaryrefslogtreecommitdiffstats
path: root/Lib/trace.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-09-24 18:08:24 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-09-24 18:08:24 (GMT)
commit402392bd5afffedf38b0270a3122e4687bdd13a2 (patch)
tree7fbd9df30200dfeaa7f6343e970c6ded0dd534fb /Lib/trace.py
parenta4c8ecd32efe42895a21a1b0836c35559f8a6b23 (diff)
downloadcpython-402392bd5afffedf38b0270a3122e4687bdd13a2.zip
cpython-402392bd5afffedf38b0270a3122e4687bdd13a2.tar.gz
cpython-402392bd5afffedf38b0270a3122e4687bdd13a2.tar.bz2
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.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/trace.py b/Lib/trace.py
index c98a6db..7260d3e 100644
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -59,7 +59,7 @@ import token
import tokenize
import inspect
import gc
-
+import dis
import pickle
def usage(outfile):
@@ -376,13 +376,7 @@ def find_lines_from_code(code, strs):
"""Return dict where keys are lines in the line number table."""
linenos = {}
- line_increments = 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