Fixed a merge error, _execute returns three values in 1.3.0, not two

This commit is contained in:
Gina Häußge 2016-09-01 10:29:29 +02:00
parent eb4be89d39
commit 6f48ca68e2

View file

@ -113,11 +113,11 @@ def _git(args, cwd, verbose=False, git_executable=None):
if verbose:
print("unable to run %s" % args[0])
print(e)
return None, None
return None, None, None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None, None
return None, None, None
def _python(args, cwd, python_executable, sudo=False):
@ -127,7 +127,7 @@ def _python(args, cwd, python_executable, sudo=False):
try:
return _execute(command, cwd=cwd)
except:
return None, None
return None, None, None
def _to_error(*lines):
@ -173,16 +173,16 @@ def update_source(git_executable, folder, target, force=False, branch=None):
raise RuntimeError("Could not update, \"git clean -f\" failed with returcode %d: %s" % (returncode, _to_error(*stdout)))
print(">>> Running: git fetch")
returncode, stdout = _git(["fetch"], folder, git_executable=git_executable)
returncode, stdout, stderr = _git(["fetch"], folder, git_executable=git_executable)
if returncode != 0:
raise RuntimeError("Could not update, \"git fetch\" failed with returncode %d: %s" % (returncode, stdout))
raise RuntimeError("Could not update, \"git fetch\" failed with returncode %d: %s" % (returncode, _to_error(*stdout)))
print(stdout)
if branch is not None and branch.strip() != "":
print(">>> Running: git checkout {}".format(branch))
returncode, stdout = _git(["checkout", branch], folder, git_executable=git_executable)
returncode, stdout, stderr = _git(["checkout", branch], folder, git_executable=git_executable)
if returncode != 0:
raise RuntimeError("Could not update, \"git checkout\" failed with returncode %d: %s" % (returncode, stdout))
raise RuntimeError("Could not update, \"git checkout\" failed with returncode %d: %s" % (returncode, _to_error(*stdout)))
print(">>> Running: git pull")
returncode, stdout, stderr = _git(["pull"], folder, git_executable=git_executable)