Skip to content

Commit cf70084

Browse files
TTsangSCErotemic
authored andcommitted
Fixed the bug
1 parent f97bfd5 commit cf70084

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

line_profiler/_line_profiler.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,11 @@ cdef class LineProfiler:
504504
construct something similar for backwards compatibility.
505505
"""
506506
c_last_time = self.c_last_time
507-
code_hash_map = self.code_hash_map
508507
py_last_time = {}
509-
for code, code_hashes in code_hash_map.items():
510-
for code_hash in code_hashes:
511-
if code_hash in c_last_time:
512-
py_last_time[code] = c_last_time[code_hash]
508+
for code in self.code_hash_map:
509+
block_hash = hash(code.co_code)
510+
if block_hash in c_last_time:
511+
py_last_time[code] = c_last_time[block_hash]
513512
return py_last_time
514513

515514

0 commit comments

Comments
 (0)