##// END OF EJS Templates
run-tests: fix _findprogram to reliably return bytes
Augie Fackler -
r25038:66da8945 default
parent child Browse files
Show More
@@ -2099,7 +2099,13 b' class TestRunner(object):'
2099
2099
2100 def _findprogram(self, program):
2100 def _findprogram(self, program):
2101 """Search PATH for a executable program"""
2101 """Search PATH for a executable program"""
2102 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
2102 if sys.version_info[0] > 2:
2103 dpb = os.defpath.encode('utf-8')
2104 sepb = os.pathsep.encode('utf-8')
2105 else:
2106 dpb = os.defpath
2107 sepb = os.pathsep
2108 for p in osenvironb.get(b'PATH', dpb).split(sepb):
2103 name = os.path.join(p, program)
2109 name = os.path.join(p, program)
2104 if os.name == 'nt' or os.access(name, os.X_OK):
2110 if os.name == 'nt' or os.access(name, os.X_OK):
2105 return name
2111 return name
General Comments 0
You need to be logged in to leave comments. Login now