##// END OF EJS Templates
catch errors at a lower level in interact...
MinRK -
Show More
@@ -20,6 +20,7 b' except ImportError:'
20 from IPython.utils.signatures import signature, Parameter
20 from IPython.utils.signatures import signature, Parameter
21 from inspect import getcallargs
21 from inspect import getcallargs
22
22
23 from IPython.core.getipython import get_ipython
23 from IPython.html.widgets import (Widget, TextWidget,
24 from IPython.html.widgets import (Widget, TextWidget,
24 FloatSliderWidget, IntSliderWidget, CheckboxWidget, DropdownWidget,
25 FloatSliderWidget, IntSliderWidget, CheckboxWidget, DropdownWidget,
25 ContainerWidget, DOMWidget)
26 ContainerWidget, DOMWidget)
@@ -205,7 +206,14 b' def interactive(__interact_f, **kwargs):'
205 container.kwargs[widget.description] = value
206 container.kwargs[widget.description] = value
206 if co:
207 if co:
207 clear_output(wait=True)
208 clear_output(wait=True)
208 container.result = f(**container.kwargs)
209 try:
210 container.result = f(**container.kwargs)
211 except Exception as e:
212 ip = get_ipython()
213 if ip is None:
214 container.log.warn("Exception in interact callback: %s", e, exc_info=True)
215 else:
216 ip.showtraceback()
209
217
210 # Wire up the widgets
218 # Wire up the widgets
211 for widget in kwargs_widgets:
219 for widget in kwargs_widgets:
General Comments 0
You need to be logged in to leave comments. Login now