diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-01-01 00:26:41 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-01-01 00:26:41 (GMT) |
commit | 38f11101d863445eba29612178fb7ba7fd424d8c (patch) | |
tree | d812887af65a3d76d7e938a3b1e48e389b756446 /Lib/idlelib | |
parent | 7cca3d8ef011446af1cc940606fda17f902a1e60 (diff) | |
download | cpython-38f11101d863445eba29612178fb7ba7fd424d8c.zip cpython-38f11101d863445eba29612178fb7ba7fd424d8c.tar.gz cpython-38f11101d863445eba29612178fb7ba7fd424d8c.tar.bz2 |
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.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/Debugger.py | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py index 3ad6a83..5f85182 100644 --- a/Lib/idlelib/Debugger.py +++ b/Lib/idlelib/Debugger.py @@ -15,7 +15,7 @@ class Idb(bdb.Bdb): def user_line(self, frame): co_filename = frame.f_code.co_filename - co_name = frame.f_code.co_name +## co_name = frame.f_code.co_name ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name ## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename @@ -23,28 +23,26 @@ class Idb(bdb.Bdb): ## print>>sys.__stderr__, "*name: ", co_name ## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None) - try: - # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the - # XXX currently running function. If the function has an - # attribute called "DebuggerStepThrough", prevent the debugger - # from stepping through Idle code. The following doesn't work - # in instance methods. Hard coded some workarounds. - - func = frame.f_locals[co_name] - if getattr(func, "DebuggerStepThrough", 0): - print "XXXX DEBUGGER STEPPING THROUGH" - self.set_step() - return - except: - pass +## try: +## # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the +## # XXX currently running function. If the function has an +## # attribute called "DebuggerStepThrough", prevent the debugger +## # from stepping through Idle code. The following doesn't work +## # in instance methods. Hard coded some workarounds. +## func = frame.f_locals[co_name] +## if getattr(func, "DebuggerStepThrough", 0): +## print "XXXX DEBUGGER STEPPING THROUGH" +## self.set_step() +## return +## except: +## pass # workaround for the problem above - if co_filename in (r'.\rpc.py', 'rpc.py','<string>'): - self.set_step() - return - if co_filename.endswith('threading.py'): - self.set_step() - return + exclude = ('rpc.py', 'threading.py', '<string>') + for rpcfile in exclude: + if co_filename.count(rpcfile): + self.set_step() + return message = self.__frame2message(frame) self.gui.interaction(message, frame) |