File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -880,24 +880,29 @@ def get_dependencies(name, environ):
880880 Uses otool on darwin, ldd on linux. Currently doesn't support windows.
881881
882882 """
883+ command = None
883884 if sys .platform == 'darwin' :
884- proc = sp .Popen (
885- 'otool -L `which %s`' % name ,
886- stdout = sp .PIPE ,
887- stderr = sp .PIPE ,
888- shell = True ,
889- env = environ )
885+ command = 'otool -L `which %s`' % name
890886 elif 'linux' in sys .platform :
887+ command = 'ldd `which %s`' % name
888+ else :
889+ return 'Platform %s not supported' % sys .platform
890+
891+ deps = None
892+ try :
891893 proc = sp .Popen (
892- 'ldd `which %s`' % name ,
894+ command ,
893895 stdout = sp .PIPE ,
894896 stderr = sp .PIPE ,
895897 shell = True ,
896898 env = environ )
897- else :
898- return 'Platform %s not supported' % sys .platform
899- o , e = proc .communicate ()
900- return o .rstrip ()
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
901906
902907
903908def canonicalize_env (env ):
You can’t perform that action at this time.
0 commit comments