File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,12 @@ def _get_paths(path):
28
28
try :
29
29
from types import SimpleNamespace
30
30
except ImportError :
31
+ # Python 2:
31
32
from argparse import Namespace as SimpleNamespace
32
33
33
34
34
35
def _run_fallback (args , input = None , ** kwargs ):
36
+ # A port of subprocess.run just enough to run the tests.
35
37
process = subprocess .Popen (args , stdin = subprocess .PIPE , ** kwargs )
36
38
stdout , stderr = process .communicate (input )
37
39
retcode = process .wait ()
@@ -73,6 +75,20 @@ def print_completed_proc(proc):
73
75
74
76
75
77
def is_dynamically_linked (executable ):
78
+ """
79
+ Check if Python `executable` is (likely to be) dynamically linked.
80
+
81
+ It returns three possible values:
82
+
83
+ * `True`: Likely that it's dynamically linked.
84
+ * `False`: Likely that it's statically linked.
85
+ * `None`: Unsupported platform.
86
+
87
+ It's only "likely" since the check is by simple occurrence of a
88
+ some substrings like "libpython". For example, if there is
89
+ another library existing on the path containing "libpython", this
90
+ function may return false-positive.
91
+ """
76
92
path = which (executable )
77
93
assert os .path .exists (path )
78
94
if is_linux and which ("ldd" ):
You can’t perform that action at this time.
0 commit comments