##// END OF EJS Templates
a nicer error message when using %pylab magic...
Paul Ivanov -
Show More
@@ -2879,7 +2879,7 b' class InteractiveShell(SingletonConfigurable):'
2879 make sense in all contexts, for example a terminal ipython can't
2879 make sense in all contexts, for example a terminal ipython can't
2880 display figures inline.
2880 display figures inline.
2881 """
2881 """
2882 from IPython.core.pylabtools import mpl_runner
2882 from IPython.core.pylabtools import mpl_runner, backends
2883 # We want to prevent the loading of pylab to pollute the user's
2883 # We want to prevent the loading of pylab to pollute the user's
2884 # namespace as shown by the %who* magics, so we execute the activation
2884 # namespace as shown by the %who* magics, so we execute the activation
2885 # code in an empty namespace, and we update *both* user_ns and
2885 # code in an empty namespace, and we update *both* user_ns and
@@ -2888,7 +2888,8 b' class InteractiveShell(SingletonConfigurable):'
2888 try:
2888 try:
2889 gui = pylab_activate(ns, gui, import_all, self, welcome_message=welcome_message)
2889 gui = pylab_activate(ns, gui, import_all, self, welcome_message=welcome_message)
2890 except KeyError:
2890 except KeyError:
2891 error("Backend %r not supported" % gui)
2891 error("Backend '%s' not supported. Supported backends are: %s"
2892 % (gui, " ".join(sorted(backends.keys()))))
2892 return
2893 return
2893 except ImportError:
2894 except ImportError:
2894 error("pylab mode doesn't work as matplotlib could not be found." + \
2895 error("pylab mode doesn't work as matplotlib could not be found." + \
General Comments 0
You need to be logged in to leave comments. Login now