From 443647a2b11499088e0aae5a328331f121b4f1da Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Sun, 23 Jan 2011 23:03:28 +0000 Subject: [PATCH] made find revision method compatible with python 2.3 --- build/toolchain.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/build/toolchain.py b/build/toolchain.py index 4b4017f7..1e289044 100644 --- a/build/toolchain.py +++ b/build/toolchain.py @@ -404,11 +404,15 @@ class InternalCommands: print self.find_revision() def find_revision(self): - p = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = p.communicate() + if sys.version_info < (2, 4): + import commands + stdout = commands.getoutput('svn info') + else: + p = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() - if p.returncode != 0: - raise Exception('Could not get revision - svn info failed with code: ' + str(p.returncode)) + if p.returncode != 0: + raise Exception('Could not get revision - svn info failed with code: ' + str(p.returncode)) m = re.search('.*Revision: (\d+).*', stdout) if not m: @@ -622,7 +626,7 @@ class InternalCommands: elif type == 'mac': #ext = 'dmg' ext = 'zip' - platform = self.macPackageName + platform = self.getMacPackageName() if not platform: raise Exception('Unable to detect package platform.')