##// END OF EJS Templates
use get_ipython API function, not builtin injection, to detect IPython.
MinRK -
Show More
@@ -118,12 +118,11 b' def flush_figures():'
118 118 return show(True)
119 119 except Exception as e:
120 120 # safely show traceback if in IPython, else raise
121 try:
122 get_ipython
123 except NameError:
121 ip = get_ipython()
122 if ip is None:
124 123 raise e
125 124 else:
126 get_ipython().showtraceback()
125 ip.showtraceback()
127 126 return
128 127 try:
129 128 # exclude any figures that were closed:
@@ -133,13 +132,12 b' def flush_figures():'
133 132 display(fig)
134 133 except Exception as e:
135 134 # safely show traceback if in IPython, else raise
136 try:
137 get_ipython
138 except NameError:
135 ip = get_ipython()
136 if ip is None:
139 137 raise e
140 138 else:
141 get_ipython().showtraceback()
142 break
139 ip.showtraceback()
140 return
143 141 finally:
144 142 # clear flags for next round
145 143 show._to_draw = []
General Comments 0
You need to be logged in to leave comments. Login now