Fix version calculation for older commits on a release branch (fixes issue #2659)

This commit is contained in:
Chris Dziemborowicz
2019-05-15 14:35:41 +00:00
committed by Marshall Greenblatt
parent c7701b8a61
commit f9b042c375
3 changed files with 22 additions and 5 deletions

View File

@ -10,6 +10,7 @@ def exec_cmd(cmd, path, input_string=None):
""" Execute the specified command and return the result. """
out = ''
err = ''
ret = -1
parts = cmd.split()
try:
if input_string is None:
@ -20,6 +21,7 @@ def exec_cmd(cmd, path, input_string=None):
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate()
ret = process.returncode
else:
process = Popen(
parts,
@ -29,8 +31,9 @@ def exec_cmd(cmd, path, input_string=None):
stderr=PIPE,
shell=(sys.platform == 'win32'))
out, err = process.communicate(input=input_string)
ret = process.returncode
except IOError, (errno, strerror):
raise
except:
raise
return {'out': out, 'err': err}
return {'out': out, 'err': err, 'ret': ret}