From 4c272f34edfdaec13f7c4ff278ef569c37749eac Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 20 Aug 2015 16:41:01 -0500 Subject: [PATCH] Fix import error on IPython 3 --- spyderlib/spyder.py | 9 ++++++--- spyderlib/widgets/externalshell/start_ipython_kernel.py | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index c4dbdfa3585..eab8bb5c703 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -74,9 +74,12 @@ # Don't show IPython ShimWarning's to our users # TODO: Move to Jupyter imports in 3.1 #============================================================================== -import warnings -from IPython.utils.shimmodule import ShimWarning -warnings.simplefilter('ignore', ShimWarning) +try: + import warnings + from IPython.utils.shimmodule import ShimWarning + warnings.simplefilter('ignore', ShimWarning) +except: + pass #============================================================================== diff --git a/spyderlib/widgets/externalshell/start_ipython_kernel.py b/spyderlib/widgets/externalshell/start_ipython_kernel.py index ac36cb2e933..56a778ef595 100644 --- a/spyderlib/widgets/externalshell/start_ipython_kernel.py +++ b/spyderlib/widgets/externalshell/start_ipython_kernel.py @@ -11,9 +11,12 @@ import os.path as osp # TODO: Move to Jupyter imports in 3.1 -import warnings -from IPython.utils.shimmodule import ShimWarning -warnings.simplefilter('ignore', ShimWarning) +try: + import warnings + from IPython.utils.shimmodule import ShimWarning + warnings.simplefilter('ignore', ShimWarning) +except: + pass def sympy_config(mpl_backend):