##// END OF EJS Templates
Fixed long-standing and very subtle bug in ultratb....
Fernando Perez -
Show More
@@ -792,16 +792,22 b' class VerboseTB(TBTools):'
792 varargs, varkw,
792 varargs, varkw,
793 locals,formatvalue=var_repr))
793 locals,formatvalue=var_repr))
794 except KeyError:
794 except KeyError:
795 # Very odd crash from inspect.formatargvalues(). The
795 # This happens in situations like errors inside generator
796 # scenario under which it appeared was a call to
796 # expressions, where local variables are listed in the
797 # view(array,scale) in NumTut.view.view(), where scale had
797 # line, but can't be extracted from the frame. I'm not
798 # been defined as a scalar (it should be a tuple). Somehow
798 # 100% sure this isn't actually a bug in inspect itself,
799 # inspect messes up resolving the argument list of view()
799 # but since there's no info for us to compute with, the
800 # and barfs out. At some point I should dig into this one
800 # best we can do is report the failure and move on. Here
801 # and file a bug report about it.
801 # we must *not* call any traceback construction again,
802 inspect_error()
802 # because that would mess up use of %debug later on. So we
803 traceback.print_exc(file=self.ostream)
803 # simply report the failure and move on. The only
804 info("\nIPython's exception reporting continues...\n")
804 # limitation will be that this frame won't have locals
805 # listed in the call signature. Quite subtle problem...
806 # I can't think of a good way to validate this in a unit
807 # test, but running a script consisting of:
808 # dict( (k,v.strip()) for (k,v) in range(10) )
809 # will illustrate the error, if this exception catch is
810 # disabled.
805 call = tpl_call_fail % func
811 call = tpl_call_fail % func
806
812
807 # Initialize a list of names on the current line, which the
813 # Initialize a list of names on the current line, which the
General Comments 0
You need to be logged in to leave comments. Login now