##// END OF EJS Templates
Don't register the same callabck multiple times...
Don't register the same callabck multiple times Using the %matplotlib magics would not always work without this fix: For `%matplotlib qt5` to work, `flush_figures` should not be in `get_ipython().events.callbacks['post_execute']`. Yet without this fix: ```python Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information. IPython 7.18.1 -- An enhanced Interactive Python. In [1]: %matplotlib inline In [2]: %matplotlib inline In [3]: %matplotlib inline In [4]: %matplotlib inline In [5]: get_ipython().events.callbacks['post_execute'] Out[5]: [<bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x00000199BFE73888>>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function matplotlib.pyplot.install_repl_displayhook.<locals>.post_execute()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>] In [6]: %matplotlib qt5 In [7]: get_ipython().events.callbacks['post_execute'] Out[7]: [<bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x00000199BFE73888>>, <function matplotlib.pyplot.install_repl_displayhook.<locals>.post_execute()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>, <function ipykernel.pylab.backend_inline.flush_figures()>] In [8]: ```

File last commit:

r7846:e288666b
r26114:73ca78ca
Show More
.gitattributes
5 lines | 109 B | text/plain | TextLexer
IPython/.git_commit_info.ini export-subst
* text=auto
*.py diff=python
*.js diff=javascript
*.html diff=html