]> granicus.if.org Git - python/commitdiff
Fix test_platform on cygwin. When running from build area, sys.executable
authorAnthony Baxter <anthonybaxter@gmail.com>
Tue, 4 Apr 2006 15:52:00 +0000 (15:52 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Tue, 4 Apr 2006 15:52:00 +0000 (15:52 +0000)
is 'python'. But 'python' is actually a directory, 'python.exe' is the
executable.

Lib/test/test_platform.py

index 200fba557238d5f186fdb925561c00c87d5f01cf..22307cd65676e3a34cf0fabf33a4a59845302589 100644 (file)
@@ -63,7 +63,12 @@ class PlatformTest(unittest.TestCase):
         res = platform.dist()
 
     def test_libc_ver(self):
-        res = platform.libc_ver()
+        from sys import executable
+        import os
+        if os.path.isdir(executable) and os.path.exists(executable+'.exe'):
+            # Cygwin horror
+            executable = executable + '.exe'
+        res = platform.libc_ver(executable)
 
 def test_main():
     test_support.run_unittest(