Changeset 985 for tester


Ignore:
Timestamp:
07/08/20 20:37:58 (4 years ago)
Author:
Maciej Komosinski
Message:

Added support for Anaconda Windows Python running under CYGWIN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/tester.py

    r903 r985  
    77import telnetlib
    88
     9# detecting CYGWIN with anaconda windows python is tricky, as all standard methods consider they are running under Windows/win32/nt.
     10# Consequently, os.linesep is set incorrectly to '\r\n', so we resort to environment variable to fix this. Note that this would
     11# likely give incorrect results for python installed under cygwin, so if ever needed, we should diffrentiate these two situations.
     12#print(platform.system())
     13#print(sys.platform)
     14#for a,b in os.environ.items(): #prints all environment variables...
     15#       if 'cyg' in a or 'cyg' in b: #...that contain 'cyg' and therefore may be useful for detecting that we are running under cygwin
     16#               print(a,b)
     17CYGWIN='cygwin' in os.environ['HOME']
     18if CYGWIN:
     19        os.linesep='\n' #fix wrong value (suitable for Windows)
     20
     21
    922import comparison  # our source
    1023import globals  # our source
     24
     25
    1126
    1227
     
    150165        for rule in globals.EXERULES:
    151166                exename[0] = re.sub(rule[0], rule[1], exename[0])
     167        if CYGWIN: #somehow for anaconda under cygwin, re.sub() works incorrectly and 'anyname' with rule ('(.*)', '../\\1') yields '../anyname../'
     168                exename=['../'+name]
    152169        return exename
    153170
Note: See TracChangeset for help on using the changeset viewer.