Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c444865

Browse files
committed
No longer need to use codehack -- use co.co_firstlineno instead.
1 parent 2deb73a commit c444865

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/pdb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def do_break(self, arg):
112112
filename = self.curframe.f_code.co_filename
113113
except:
114114
# Try function name as the argument
115-
import codehack
116115
try:
117116
func = arg
118117
if hasattr(func, 'im_func'):
@@ -122,7 +121,7 @@ def do_break(self, arg):
122121
print '*** The specified object',
123122
print 'is not a function', arg
124123
return
125-
lineno = codehack.getlineno(code)
124+
lineno = code.co_firstlineno
126125
filename = code.co_filename
127126

128127
# now set the break point

0 commit comments

Comments
 (0)