Skip to content

Commit 8878c0f

Browse files
committed
Merge pull request #445 from satra/enh/travis
fix: ipython import not required for ipythonx plugin
2 parents 5549388 + 07735df commit 8878c0f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nipype/pipeline/plugins/ipythonx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
import sys
77

8-
from IPython import __version__ as IPyversion
8+
IPython_not_loaded = False
99
try:
10+
from IPython import __version__ as IPyversion
1011
from IPython.kernel.contexts import ConnectionRefusedError
1112
except:
12-
pass
13+
IPython_not_loaded = True
14+
1315

1416
from .base import (DistributedPluginBase, logger, report_crash)
1517

@@ -18,6 +20,8 @@ class IPythonXPlugin(DistributedPluginBase):
1820
"""
1921

2022
def __init__(self, plugin_args=None):
23+
if IPython_not_loaded:
24+
raise ImportError('IPython parallel could not be imported')
2125
super(IPythonXPlugin, self).__init__(plugin_args=plugin_args)
2226
self.ipyclient = None
2327
self.taskclient = None

0 commit comments

Comments
 (0)