File tree 1 file changed +16
-11
lines changed
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):
880
880
Uses otool on darwin, ldd on linux. Currently doesn't support windows.
881
881
882
882
"""
883
+ command = None
883
884
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
890
886
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 :
891
893
proc = sp .Popen (
892
- 'ldd `which %s`' % name ,
894
+ command ,
893
895
stdout = sp .PIPE ,
894
896
stderr = sp .PIPE ,
895
897
shell = True ,
896
898
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
901
906
902
907
903
908
def canonicalize_env (env ):
You can’t perform that action at this time.
0 commit comments