[pywin32-checkins] pywin32/Pythonwin/pywin/debugger debugger.py, 1.22, 1.23
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-04 01:53:34
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18367 Modified Files: debugger.py Log Message: Fix exception debugging in py3k and remove annoying '--Call--' print while stepping Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** debugger.py 26 Nov 2008 01:30:11 -0000 1.22 --- debugger.py 4 Jan 2009 01:53:29 -0000 1.23 *************** *** 580,583 **** --- 580,588 ---- self.interaction(frame, None) + def user_call(self, frame, args): + # base class has an annoying 'print' that adds no value to us... + if self.stop_here(frame): + self.interaction(frame, None) + def user_exception(self, frame, exc_info): # This function is called if an exception occurs, *************** *** 587,590 **** --- 592,607 ---- frame.f_locals['__exception__'] = exc_type, exc_value print "Unhandled exception while debugging..." + # on both py2k and py3k, we may be called with exc_value + # being the args to the exception, or it may already be + # instantiated (IOW, PyErr_Normalize() hasn't been + # called on the args). In py2k this is fine, but in + # py3k, traceback.print_exception fails. So on py3k + # we instantiate an exception instance to print. + if sys.version_info > (3,) and not isinstance(exc_value, BaseException): + # they are args - may be a single item or already a tuple + if not isinstance(exc_value, tuple): + exc_value = (exc_value,) + exc_value = exc_type(*exc_value) + traceback.print_exception(exc_type, exc_value, exc_traceback) self.interaction(frame, exc_traceback) |