We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d38861 commit fe6bcf8Copy full SHA for fe6bcf8
1 file changed
fastplotlib/layouts/_plot_area.py
@@ -15,11 +15,13 @@
15
16
17
try:
18
- ip = get_ipython()
+ get_ipython()
19
except NameError:
20
IS_IPYTHON = False
21
+ IPYTHON = None
22
else:
23
IS_IPYTHON = True
24
+ IPYTHON = get_ipython()
25
26
27
class PlotArea:
@@ -673,15 +675,13 @@ def delete_graphic(self, graphic: Graphic):
673
675
674
676
if IS_IPYTHON:
677
# remove any references that ipython might have made
-
678
# check both namespaces
679
- for namespace in [ip.user_ns, ip.user_ns_hidden]:
+ for namespace in [IPYTHON.user_ns, IPYTHON.user_ns_hidden]:
680
# find the reference
681
for ref, obj in namespace.items():
682
if graphic is obj:
683
# we found the reference, remove from ipython
684
- ip.del_var(ref)
+ IPYTHON.del_var(ref)
685
break
686
687
def clear(self):
0 commit comments