MCPcopy Index your code
hub / github.com/python/cpython / find_all_on_path

Function find_all_on_path

PCbuild/prepare_ssl.py:30–42  ·  view source on GitHub ↗
(filename, extras=None)

Source from the content-addressed store, hash-verified

28
29# Find all "foo.exe" files on the PATH.
30def find_all_on_path(filename, extras=None):
31 entries = os.environ["PATH"].split(os.pathsep)
32 ret = []
33 for p in entries:
34 fname = os.path.abspath(os.path.join(p, filename))
35 if os.path.isfile(fname) and fname not in ret:
36 ret.append(fname)
37 if extras:
38 for p in extras:
39 fname = os.path.abspath(os.path.join(p, filename))
40 if os.path.isfile(fname) and fname not in ret:
41 ret.append(fname)
42 return ret
43
44
45# Find a suitable Perl installation for OpenSSL.

Callers 1

mainFunction · 0.85

Calls 5

splitMethod · 0.45
abspathMethod · 0.45
joinMethod · 0.45
isfileMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…