]> git.phdru.name Git - ppu.git/blobdiff - tests/test_which.py
Build(GHActions): Use `checkout@v4` instead of outdated `v2`
[ppu.git] / tests / test_which.py
index 5de5a64662e9c0fac685352d452aea235286cbc9..af9886f81e68f1f142241b25096115d387914015 100755 (executable)
@@ -6,11 +6,14 @@ import sys
 from ppu_tu import setup, teardown, find_in_path  # noqa
 
 
-tmp_dir = None
-
 test_prog_path = find_in_path('which.py')
-if not test_prog_path:
-    sys.exit("Cannot find which.py in %s" % os.environ["PATH"])
+
+if sys.platform == 'win32':
+    os_env_pathext = os.environ['PATHEXT']
+    pathext = os_env_pathext.lower().split(os.pathsep)
+    if '.py' not in pathext:
+        os_env_pathext += ';.py'
+        os.environ['PATHEXT'] = os_env_pathext
 
 
 def test_which():