diff -r 4d4277941a45 Lib/test/test_sys_settrace.py --- a/Lib/test/test_sys_settrace.py Fri Apr 12 23:30:59 2013 +0300 +++ b/Lib/test/test_sys_settrace.py Sat Apr 13 19:18:19 2013 -0400 @@ -458,6 +458,26 @@ self.fail("exception not propagated") + def test_exception_arguments(self): + def f(): + x = 5 + # this should raise an error + x.no_such_attr + def g(frame, event, arg): + if (event == 'exception'): + type, exception, trace = arg + if not isinstance(exception, Exception): + self.fail("arg should be an instance of exception") + return g + + sys.settrace(g) + try: + f() + except AttributeError: + # this is expected + pass + + # 'Jump' tests: assigning to frame.f_lineno within a trace function # moves the execution position - it's how debuggers implement a Jump # command (aka. "Set next statement"). diff -r 4d4277941a45 Misc/ACKS --- a/Misc/ACKS Fri Apr 12 23:30:59 2013 +0300 +++ b/Misc/ACKS Sat Apr 13 19:18:19 2013 -0400 @@ -211,6 +211,7 @@ Nicolas Chauvat Jerry Chen Michael Chermside +Ingrid Cheung Albert Chin-A-Young Adal Chiriliuc Matt Chisholm @@ -802,6 +803,7 @@ Greg McFarlane Alan McIntyre Michael McLay +Brendan McLoughlin Mark Mc Mahon Gordon McMillan Andrew McNamara diff -r 4d4277941a45 Python/ceval.c --- a/Python/ceval.c Fri Apr 12 23:30:59 2013 +0300 +++ b/Python/ceval.c Sat Apr 13 19:18:19 2013 -0400 @@ -3793,6 +3793,7 @@ value = Py_None; Py_INCREF(value); } + PyErr_NormalizeException(&type, &value, &traceback); arg = PyTuple_Pack(3, type, value, traceback); if (arg == NULL) { PyErr_Restore(type, value, traceback);