Skip to content

Commit 38f1110

Browse files
committed
Debugger was tracing through rpc.py when IDLEfork was not started
from its source directory. Generalize the "workaround" (though the latter seems a reasonable solution?) to handle this.
1 parent 7cca3d8 commit 38f1110

1 file changed

Lines changed: 19 additions & 21 deletions

File tree

Lib/idlelib/Debugger.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,34 @@ def __init__(self, gui):
1515
def user_line(self, frame):
1616

1717
co_filename = frame.f_code.co_filename
18-
co_name = frame.f_code.co_name
18+
## co_name = frame.f_code.co_name
1919

2020
## print>>sys.__stderr__, "*function: ", frame.f_code.co_name
2121
## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename
2222
## print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno
2323
## print>>sys.__stderr__, "*name: ", co_name
2424
## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None)
2525

26-
try:
27-
# XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the
28-
# XXX currently running function. If the function has an
29-
# attribute called "DebuggerStepThrough", prevent the debugger
30-
# from stepping through Idle code. The following doesn't work
31-
# in instance methods. Hard coded some workarounds.
32-
33-
func = frame.f_locals[co_name]
34-
if getattr(func, "DebuggerStepThrough", 0):
35-
print "XXXX DEBUGGER STEPPING THROUGH"
36-
self.set_step()
37-
return
38-
except:
39-
pass
26+
## try:
27+
## # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the
28+
## # XXX currently running function. If the function has an
29+
## # attribute called "DebuggerStepThrough", prevent the debugger
30+
## # from stepping through Idle code. The following doesn't work
31+
## # in instance methods. Hard coded some workarounds.
32+
## func = frame.f_locals[co_name]
33+
## if getattr(func, "DebuggerStepThrough", 0):
34+
## print "XXXX DEBUGGER STEPPING THROUGH"
35+
## self.set_step()
36+
## return
37+
## except:
38+
## pass
4039

4140
# workaround for the problem above
42-
if co_filename in (r'.\rpc.py', 'rpc.py','<string>'):
43-
self.set_step()
44-
return
45-
if co_filename.endswith('threading.py'):
46-
self.set_step()
47-
return
41+
exclude = ('rpc.py', 'threading.py', '<string>')
42+
for rpcfile in exclude:
43+
if co_filename.count(rpcfile):
44+
self.set_step()
45+
return
4846
message = self.__frame2message(frame)
4947
self.gui.interaction(message, frame)
5048

0 commit comments

Comments
 (0)