diff options
author | Milas Bowman <milas.bowman@docker.com> | 2022-08-12 09:19:47 -0400 |
---|---|---|
committer | Milas Bowman <milas.bowman@docker.com> | 2022-08-12 09:21:51 -0400 |
commit | c03aeb659e2ac996aa69927e928b73d2979b9fce (patch) | |
tree | fe885ca150c72bfb2f2be760333d459df61c708f /docker/credentials/utils.py | |
parent | 656db96b4a8b0db28d4b19ca60c95036c995175b (diff) | |
parent | 58aa62bb154a2ccea433cf475aefbd695fb5abc8 (diff) | |
download | docker-py-c03aeb659e2ac996aa69927e928b73d2979b9fce.tar.gz |
Merge remote-tracking branch 'upstream/main' into connect-with-mac
Diffstat (limited to 'docker/credentials/utils.py')
-rw-r--r-- | docker/credentials/utils.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/docker/credentials/utils.py b/docker/credentials/utils.py index 3f720ef..5c83d05 100644 --- a/docker/credentials/utils.py +++ b/docker/credentials/utils.py @@ -1,32 +1,4 @@ -import distutils.spawn import os -import sys - - -def find_executable(executable, path=None): - """ - As distutils.spawn.find_executable, but on Windows, look up - every extension declared in PATHEXT instead of just `.exe` - """ - if sys.platform != 'win32': - return distutils.spawn.find_executable(executable, path) - - if path is None: - path = os.environ['PATH'] - - paths = path.split(os.pathsep) - extensions = os.environ.get('PATHEXT', '.exe').split(os.pathsep) - base, ext = os.path.splitext(executable) - - if not os.path.isfile(executable): - for p in paths: - for ext in extensions: - f = os.path.join(p, base + ext) - if os.path.isfile(f): - return f - return None - else: - return executable def create_environment_dict(overrides): |