File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -123,15 +123,18 @@ def getexecutable(name, cache={}):
123123 except KeyError :
124124 executable = py .path .local .sysfind (name )
125125 if executable :
126+ import subprocess
127+ popen = subprocess .Popen ([str (executable ), "--version" ],
128+ universal_newlines = True , stderr = subprocess .PIPE )
129+ out , err = popen .communicate ()
126130 if name == "jython" :
127- import subprocess
128- popen = subprocess .Popen ([str (executable ), "--version" ],
129- universal_newlines = True , stderr = subprocess .PIPE )
130- out , err = popen .communicate ()
131131 if not err or "2.5" not in err :
132132 executable = None
133133 if "2.5.2" in err :
134134 executable = None # http://bugs.jython.org/issue1790
135+ elif popen .returncode != 0 :
136+ # Handle pyenv's 127.
137+ executable = None
135138 cache [name ] = executable
136139 return executable
137140
You can’t perform that action at this time.
0 commit comments