Commit 753d59c1 authored by Ian Lynagh's avatar Ian Lynagh

Change how we detect whether the terminal is cygwin or msys

sys.platform now always returns 'win32' for me.
parent b4d34d4c
......@@ -18,11 +18,6 @@ from testglobals import *
# value.
os.environ['TERM'] = 'vt100'
if sys.platform == "cygwin":
cygwin = True
else:
cygwin = False
global config
config = getConfig() # get it from testglobals
......@@ -115,15 +110,20 @@ if config.use_threads == 1:
config.cygwin = False
config.msys = False
if windows:
if cygwin:
h = os.popen('uname -s', 'r')
v = h.read()
h.close()
if v.startswith("CYGWIN"):
config.cygwin = True
else:
elif v.startswith("MINGW32"):
config.msys = True
else:
raise Exception("Can't detect Windows terminal type")
# Try to use UTF8
if windows:
import ctypes
if cygwin:
if config.cygwin:
# Is this actually right? Which calling convention does it use?
# As of the time of writing, ctypes.windll doesn't exist in the
# cygwin python, anyway.
......@@ -182,7 +182,7 @@ if windows or darwin:
path = re.sub('^"(.*)"$', '\\1', path)
path = re.sub('\\\\(.)', '\\1', path)
if windows:
if cygwin:
if config.cygwin:
# On cygwin we can't put "c:\foo" in $PATH, as : is a
# field separator. So convert to /cygdrive/c/foo instead.
# Other pythons use ; as the separator, so no problem.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment