From 2c320bb24efaed4277e0ccb449fe0828fc00c91c Mon Sep 17 00:00:00 2001 From: David Drinn Date: Thu, 9 May 2019 15:25:12 -0700 Subject: [PATCH] Windows _which: Allow ext search for all paths Prior to this fix, gpg.exe will only be found if it's in the first path. --- pretty_bad_protocol/_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pretty_bad_protocol/_util.py b/pretty_bad_protocol/_util.py index 1f4e4a5..5fd3384 100644 --- a/pretty_bad_protocol/_util.py +++ b/pretty_bad_protocol/_util.py @@ -710,7 +710,6 @@ def _can_allow(p): return True result = [] - exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep)) path = os.environ.get('PATH', None) if path is None: return [] @@ -718,6 +717,7 @@ def _can_allow(p): p = os.path.join(p, executable) if _can_allow(p): result.append(p) + exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep)) for e in exts: pext = p + e if _can_allow(pext):