Skip to content

Commit 060cc49

Browse files
committed
more reliable get_dependencies
1 parent 8c65fbf commit 060cc49

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

nipype/utils/filemanip.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,21 @@ def get_dependencies(name, environ):
888888
else:
889889
return 'Platform %s not supported' % sys.platform
890890

891-
proc = sp.Popen(
892-
command,
893-
stdout=sp.PIPE,
894-
stderr=sp.PIPE,
895-
shell=True,
896-
env=environ)
897-
o, e = proc.communicate()
898-
return o.rstrip()
891+
deps = None
892+
try:
893+
proc = sp.Popen(
894+
command,
895+
stdout=sp.PIPE,
896+
stderr=sp.PIPE,
897+
shell=True,
898+
env=environ)
899+
o, e = proc.communicate()
900+
deps = o.rstrip()
901+
except Exception as ex:
902+
deps = '"%s" failed' % command
903+
fmlogger.warning('Could not get dependencies of %s. Error:\n%s',
904+
name, ex.message)
905+
return deps
899906

900907

901908
def canonicalize_env(env):

0 commit comments

Comments
 (0)