From: Brian Warner Date: Wed, 16 May 2007 18:57:20 +0000 (-0700) Subject: make-version.py: use 'subprocess' module instead of 'commands', to improve windows... X-Git-Tag: allmydata-tahoe-0.3.0~78 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/%3C?a=commitdiff_plain;h=b90d4a243e677a003849a9579c5c026c94e7d2c8;p=tahoe-lafs%2Ftahoe-lafs.git make-version.py: use 'subprocess' module instead of 'commands', to improve windows compatibility --- diff --git a/misc/make-version.py b/misc/make-version.py index a4f68164..c3d284c3 100644 --- a/misc/make-version.py +++ b/misc/make-version.py @@ -33,8 +33,9 @@ get 'darcs changes --from-tag=' to accept real regexps). """ -import os, sys, commands, re +import os, sys, re import xml.dom.minidom +from subprocess import Popen, PIPE def get_text(nodelist): rc = "" @@ -68,8 +69,10 @@ def update(): return 0 print "no _darcs/ but no version.py either: how did you get this tree?" return 0 - cmd = "darcs changes --from-tag=^allmydata-tahoe --xml-output" - (rc, output) = commands.getstatusoutput(cmd) + cmd = ["darcs", "changes", "--from-tag=^allmydata-tahoe", "--xml-output"] + p = Popen(cmd, stdout=PIPE) + output = p.communicate()[0] + rc = p.returncode if rc != 0: print "unable to run 'darcs changes':" print output