Changeset 28f3a19 for src/tests/pybin/tools.py
- Timestamp:
- Jun 27, 2018, 3:28:41 PM (7 years ago)
- Branches:
- new-env, with_gc
- Children:
- b21c77a
- Parents:
- 0182bfa (diff), 63238a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/pybin/tools.py
r0182bfa r28f3a19 83 83 return sh(cmd) 84 84 85 def which(program): 86 import os 87 def is_exe(fpath): 88 return os.path.isfile(fpath) and os.access(fpath, os.X_OK) 89 90 fpath, fname = os.path.split(program) 91 if fpath: 92 if is_exe(program): 93 return program 94 else: 95 for path in os.environ["PATH"].split(os.pathsep): 96 exe_file = os.path.join(path, program) 97 if is_exe(exe_file): 98 return exe_file 99 100 return None 85 101 ################################################################################ 86 102 # file handling … … 219 235 return False 220 236 237 def fancy_print(text): 238 column = which('column') 239 if column: 240 cmd = "%s 2> /dev/null" % column 241 print(cmd) 242 proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True) 243 proc.communicate(input=text) 244 else: 245 print(text) 221 246 222 247 settings.set_machine_default( getMachineType )
Note:
See TracChangeset
for help on using the changeset viewer.