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):