Skip to content

Commit 81440b8

Browse files
authored
Merge pull request #1717 from alexsavio/updt2boutiq
update import in nipype2boutiques
2 parents 3460d6a + df2894d commit 81440b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nipype/scripts/instance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ def import_module(module_path):
2828
"""
2929
try:
3030
mod = importlib.import_module(module_path)
31-
return mod
3231
except:
3332
raise ImportError('Error when importing object {}.'.format(module_path))
33+
else:
34+
return mod
3435

3536

3637
def list_interfaces(module):

nipype/utils/nipype2boutiques.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import tempfile
2121
import simplejson as json
2222

23+
from ..scripts.instance import import_module
24+
2325

2426
def generate_boutiques_descriptor(module, interface_name, ignored_template_inputs, docker_image, docker_index, verbose, ignore_template_numbers):
2527
'''
@@ -36,7 +38,7 @@ def generate_boutiques_descriptor(module, interface_name, ignored_template_input
3638

3739
# Retrieves Nipype interface
3840
if isinstance(module, str):
39-
__import__(module)
41+
import_module(module)
4042
module_name = str(module)
4143
module = sys.modules[module]
4244

0 commit comments

Comments
 (0)