mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-29 14:12:37 +03:00
made find revision method compatible with python 2.3
This commit is contained in:
parent
3b3d292f0f
commit
443647a2b1
@ -404,11 +404,15 @@ class InternalCommands:
|
|||||||
print self.find_revision()
|
print self.find_revision()
|
||||||
|
|
||||||
def find_revision(self):
|
def find_revision(self):
|
||||||
p = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
if sys.version_info < (2, 4):
|
||||||
stdout, stderr = p.communicate()
|
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:
|
if p.returncode != 0:
|
||||||
raise Exception('Could not get revision - svn info failed with code: ' + str(p.returncode))
|
raise Exception('Could not get revision - svn info failed with code: ' + str(p.returncode))
|
||||||
|
|
||||||
m = re.search('.*Revision: (\d+).*', stdout)
|
m = re.search('.*Revision: (\d+).*', stdout)
|
||||||
if not m:
|
if not m:
|
||||||
@ -622,7 +626,7 @@ class InternalCommands:
|
|||||||
elif type == 'mac':
|
elif type == 'mac':
|
||||||
#ext = 'dmg'
|
#ext = 'dmg'
|
||||||
ext = 'zip'
|
ext = 'zip'
|
||||||
platform = self.macPackageName
|
platform = self.getMacPackageName()
|
||||||
|
|
||||||
if not platform:
|
if not platform:
|
||||||
raise Exception('Unable to detect package platform.')
|
raise Exception('Unable to detect package platform.')
|
||||||
|
Loading…
Reference in New Issue
Block a user