MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / _which

Function _which

sshuttle/helpers.py:234–246  ·  view source on GitHub ↗
(file, mode=os.F_OK | os.X_OK, path=None)

Source from the content-addressed store, hash-verified

232 # Python, some still run the sshuttle server on remote machines
233 # with old versions of python.
234 def _which(file, mode=os.F_OK | os.X_OK, path=None):
235 if path is not None:
236 search_paths = path.split(os.pathsep)
237 elif "PATH" in os.environ:
238 search_paths = os.environ["PATH"].split(os.pathsep)
239 else:
240 search_paths = os.defpath.split(os.pathsep)
241
242 for p in search_paths:
243 filepath = os.path.join(p, file)
244 if os.path.exists(filepath) and os.access(filepath, mode):
245 return filepath
246 return None
247
248
249def which(file, mode=os.F_OK | os.X_OK):

Callers 1

whichFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected