Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/debugger
Modified Files:
__init__.py debugger.py
Log Message:
Various modernizations to .py code via the py3k branch.
Index: debugger.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** debugger.py 1 Oct 2008 14:44:52 -0000 1.20
--- debugger.py 14 Nov 2008 00:22:25 -0000 1.21
***************
*** 58,62 ****
if not name or name == '?' :
# See if locals has a '__name__' (ie, a module)
! if self.myobject.f_locals.has_key('__name__'):
name = str(self.myobject.f_locals['__name__']) + " module"
else:
--- 58,62 ----
if not name or name == '?' :
# See if locals has a '__name__' (ie, a module)
! if '__name__' in self.myobject.f_locals:
name = str(self.myobject.f_locals['__name__']) + " module"
else:
***************
*** 315,319 ****
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.values():
for bp in bplist:
if id(bp)==item_id:
--- 315,319 ----
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.itervalues():
for bp in bplist:
if id(bp)==item_id:
***************
*** 329,333 ****
item_id = self.GetItem(num)[6]
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.values():
for bp in bplist:
if id(bp)==item_id:
--- 329,333 ----
item_id = self.GetItem(num)[6]
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.itervalues():
for bp in bplist:
if id(bp)==item_id:
***************
*** 339,353 ****
def RespondDebuggerData(self):
! list = self
! list.DeleteAllItems()
index = -1
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.values():
for bp in bplist:
baseName = os.path.split(bp.file)[1]
cond = bp.cond
item = index+1, 0, 0, 0, str(cond), 0, id(bp)
! index = list.InsertItem(item)
! list.SetItemText(index, 1, "%s: %s" % (baseName, bp.line))
class DebuggerWatchWindow(DebuggerListViewWindow):
--- 339,353 ----
def RespondDebuggerData(self):
! l = self
! l.DeleteAllItems()
index = -1
from bdb import Breakpoint
! for bplist in Breakpoint.bplist.itervalues():
for bp in bplist:
baseName = os.path.split(bp.file)[1]
cond = bp.cond
item = index+1, 0, 0, 0, str(cond), 0, id(bp)
! index = l.InsertItem(item)
! l.SetItemText(index, 1, "%s: %s" % (baseName, bp.line))
class DebuggerWatchWindow(DebuggerListViewWindow):
***************
*** 583,589 ****
self.interaction(frame, None)
! def user_exception(self, frame, (exc_type, exc_value, exc_traceback)):
# This function is called if an exception occurs,
# but only if we are to stop at or just below this level
if self.get_option(OPT_STOP_EXCEPTIONS):
frame.f_locals['__exception__'] = exc_type, exc_value
--- 583,590 ----
self.interaction(frame, None)
! def user_exception(self, frame, exc_info):
# This function is called if an exception occurs,
# but only if we are to stop at or just below this level
+ (exc_type, exc_value, exc_traceback) = exc_info
if self.get_option(OPT_STOP_EXCEPTIONS):
frame.f_locals['__exception__'] = exc_type, exc_value
***************
*** 711,715 ****
# '_debugger_stop_frame_', and we dont go past it
# (everything above this is Pythonwin framework code)
! if frame.f_locals.has_key("_debugger_stop_frame_"):
self.userbotframe = frame
break
--- 712,716 ----
# '_debugger_stop_frame_', and we dont go past it
# (everything above this is Pythonwin framework code)
! if "_debugger_stop_frame_" in frame.f_locals:
self.userbotframe = frame
break
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/__init__.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** __init__.py 23 Oct 2008 03:39:13 -0000 1.6
--- __init__.py 14 Nov 2008 00:22:25 -0000 1.7
***************
*** 64,68 ****
def runcall(*args):
! return apply(_GetCurrentDebugger().runcall, args)
def set_trace():
--- 64,68 ----
def runcall(*args):
! return _GetCurrentDebugger().runcall(*args)
def set_trace():
***************
*** 100,104 ****
sys.settrace(None)
p.reset()
! while t.tb_next <> None: t = t.tb_next
p.bAtPostMortem = 1
p.prep_run(None)
--- 100,104 ----
sys.settrace(None)
p.reset()
! while t.tb_next != None: t = t.tb_next
p.bAtPostMortem = 1
p.prep_run(None)
|