- Timestamp:
- 07/08/20 20:37:58 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester/tester.py
r903 r985 7 7 import telnetlib 8 8 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) 17 CYGWIN='cygwin' in os.environ['HOME'] 18 if CYGWIN: 19 os.linesep='\n' #fix wrong value (suitable for Windows) 20 21 9 22 import comparison # our source 10 23 import globals # our source 24 25 11 26 12 27 … … 150 165 for rule in globals.EXERULES: 151 166 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] 152 169 return exename 153 170
Note: See TracChangeset
for help on using the changeset viewer.