On 13 Mar 2014 at 21:48:16 , Georg Baum (georg.b...@post.rwth-aachen.de) wrote:
Benjamin Piwowarski wrote: 

> I have another question (this was what I was trying to fix also): 
> - why the python2() code in os.cpp (line 41) does not prevent the wrong 
> python to be selected. 

I think this is the most important question. After all, we do not have 
control over PATH, and in many cases we cannot set a sensible path prefix 
(e.g. on many linux systems).  


> In particular, why is the test out.first < 0 and 
> not out.first != 0 ? 

Because out.first is -1 on error. It is either a hard coded -1 in LyX, or 
the return value of pclose(), _pclose() or fclose(). Which one is used on OS 
X? What does it retun on error? 
This is the in the documentation of popen/pclose: the pclose() function waits 
for the associated process to terminate; it returns the exit status of the 
command, as returned by wait4(2).



> This would have prevented the python3 version from being selected. 

Why? This means that prefixIs(out.second, "Python 2") returns true for 
python 3. How can that happen? 


You are right. Just read to fast the condition.

Reply via email to