| 1 |
--- a/SConstruct 2012-08-20 10:26:51.484835418 +0200 |
| 2 |
+++ b/SConstruct 2012-08-20 10:27:49.855374497 +0200 |
| 3 |
@@ -765,11 +765,16 @@ |
| 4 |
binaries = ['python', 'python2.5', 'python2.6', 'python2.7', 'python25', 'python26', 'python27'] |
| 5 |
for binary in binaries: |
| 6 |
try: |
| 7 |
- # py-2.4 compatible replacement for shell backticks |
| 8 |
- output = subprocess.Popen([binary, '--version'], stdout=subprocess.PIPE).communicate()[0] |
| 9 |
- match = version.search(output) |
| 10 |
- if match and float(match.group(1)) >= 2.5: |
| 11 |
- return binary |
| 12 |
+ for path in smokeEnv['ENV']['PATH'].split(':'): |
| 13 |
+ if os.path.isfile( '%s/%s' % (path, binary) ): |
| 14 |
+ # py-2.4 compatible replacement for shell backticks |
| 15 |
+ out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() |
| 16 |
+ for stream in (out, err): |
| 17 |
+ match = version.search(stream) |
| 18 |
+ if match: |
| 19 |
+ versiontuple = tuple(map(int, match.group(1).split('.'))) |
| 20 |
+ if versiontuple >= (2, 5): |
| 21 |
+ return binary |
| 22 |
except: |
| 23 |
pass |
| 24 |
|