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.
This commit is contained in:
Anthony Baxter 2006-04-04 15:52:00 +00:00
parent b2fc21e9f8
commit 06853fc150
1 changed files with 6 additions and 1 deletions

View 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(