From: Anthony Baxter Date: Tue, 4 Apr 2006 15:52:00 +0000 (+0000) Subject: Fix test_platform on cygwin. When running from build area, sys.executable X-Git-Tag: v2.5a1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06853fc15055686ec02fd2671fd37cda0f69209b;p=thirdparty%2FPython%2Fcpython.git Fix test_platform on cygwin. When running from build area, sys.executable is 'python'. But 'python' is actually a directory, 'python.exe' is the executable. --- diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 200fba557238..22307cd65676 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -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(