Merge pull request #1624 from blueyed/getexecutable-skip-non-zero-returncode
tests: getexecutable: call `--version` on all Pythons
This commit is contained in:
		
						commit
						406355fd10
					
				|  | @ -123,15 +123,18 @@ def getexecutable(name, cache={}): | ||||||
|     except KeyError: |     except KeyError: | ||||||
|         executable = py.path.local.sysfind(name) |         executable = py.path.local.sysfind(name) | ||||||
|         if executable: |         if executable: | ||||||
|  |             import subprocess | ||||||
|  |             popen = subprocess.Popen([str(executable), "--version"], | ||||||
|  |                 universal_newlines=True, stderr=subprocess.PIPE) | ||||||
|  |             out, err = popen.communicate() | ||||||
|             if name == "jython": |             if name == "jython": | ||||||
|                 import subprocess |  | ||||||
|                 popen = subprocess.Popen([str(executable), "--version"], |  | ||||||
|                     universal_newlines=True, stderr=subprocess.PIPE) |  | ||||||
|                 out, err = popen.communicate() |  | ||||||
|                 if not err or "2.5" not in err: |                 if not err or "2.5" not in err: | ||||||
|                     executable = None |                     executable = None | ||||||
|                 if "2.5.2" in err: |                 if "2.5.2" in err: | ||||||
|                     executable = None # http://bugs.jython.org/issue1790 |                     executable = None # http://bugs.jython.org/issue1790 | ||||||
|  |             elif popen.returncode != 0: | ||||||
|  |                 # Handle pyenv's 127. | ||||||
|  |                 executable = None | ||||||
|         cache[name] = executable |         cache[name] = executable | ||||||
|         return executable |         return executable | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue