[pony-build] python version number stuff -- which branch?

C. Titus Brown ctb at msu.edu
Sat Apr 17 06:19:06 PDT 2010


On Mon, Apr 05, 2010 at 03:09:38PM -0400, Jack Carlson wrote:
> I...  Think so?
> 
> It's in my master branch, should all be working/throws exceptions instead of returning errors if theres issues, etc.

Hi Jack,

I went through your code.  A few comments --

Your original code was kind of spaghetti-ish, with one long compound
   statement:


   result = subprocess.Popen(python_exe + " -c \"import sys \nprint" \ 
    " str(sys.version_info[0]) + '.' + str(sys.version_info[1])\"", shell=True, \
     stdout=subprocess.PIPE).communicate()


I broke this up into three statements:

    cmd = python_exe + " -c \"import sys \nprint" \
    " str(sys.version_info[0]) + '.' + str(sys.version_info[1])\""

    p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
    (stdout, stderr) = p.communicate()

because that way it's readable :).

Also, you were using 'result' as a tuple; easier to just unpack it, as in
the last line of the above.

Here's my commit and merge:

http://github.com/ctb/pony-build/commit/33d19eba80f73aa046bb481601474c984e083d29

--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the pony-build mailing list