File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 15
15
16
16
17
17
try :
18
- ip = get_ipython ()
18
+ get_ipython ()
19
19
except NameError :
20
20
IS_IPYTHON = False
21
+ IPYTHON = None
21
22
else :
22
23
IS_IPYTHON = True
24
+ IPYTHON = get_ipython ()
23
25
24
26
25
27
class PlotArea :
@@ -673,15 +675,13 @@ def delete_graphic(self, graphic: Graphic):
673
675
674
676
if IS_IPYTHON :
675
677
# remove any references that ipython might have made
676
- ip = get_ipython ()
677
-
678
678
# check both namespaces
679
- for namespace in [ip .user_ns , ip .user_ns_hidden ]:
679
+ for namespace in [IPYTHON .user_ns , IPYTHON .user_ns_hidden ]:
680
680
# find the reference
681
681
for ref , obj in namespace .items ():
682
682
if graphic is obj :
683
683
# we found the reference, remove from ipython
684
- ip .del_var (ref )
684
+ IPYTHON .del_var (ref )
685
685
break
686
686
687
687
def clear (self ):
You can’t perform that action at this time.
0 commit comments