Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,24 +880,29 @@ def get_dependencies(name, environ):
Uses otool on darwin, ldd on linux. Currently doesn't support windows.

"""
command = None
if sys.platform == 'darwin':
proc = sp.Popen(
'otool -L `which %s`' % name,
stdout=sp.PIPE,
stderr=sp.PIPE,
shell=True,
env=environ)
command = 'otool -L `which %s`' % name
elif 'linux' in sys.platform:
command = 'ldd `which %s`' % name
else:
return 'Platform %s not supported' % sys.platform

deps = None
try:
proc = sp.Popen(
'ldd `which %s`' % name,
command,
stdout=sp.PIPE,
stderr=sp.PIPE,
shell=True,
env=environ)
else:
return 'Platform %s not supported' % sys.platform
o, e = proc.communicate()
return o.rstrip()
o, e = proc.communicate()
deps = o.rstrip()
except Exception as ex:
deps = '"%s" failed' % command
fmlogger.warning('Could not get dependencies of %s. Error:\n%s',
name, ex.message)
return deps


def canonicalize_env(env):
Expand Down