8000 FIX : logic for IPython hook registration · matplotlib/matplotlib@a26831d · GitHub
[go: up one dir, main page]

Skip to content

Commit a26831d

Browse files
committed
FIX : logic for IPython hook registration
Only set the global _IP_REGISTERED if the registration succeeds, with the finally block it would be set if _both_ failed.
1 parent 54da8cc commit a26831d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def displayhook():
146146
except AttributeError:
147147
# IPython 1.x
148148
ip.register_post_execute(displayhook)
149-
finally:
150-
_IP_REGISTERED = displayhook
149+
150+
_IP_REGISTERED = displayhook
151151

152152
# import failed or ipython is not running
153153
except (ImportError, _NotIPython):

0 commit comments

Comments
 (0)
0