From c15683906c68f2714c72b5cf20e2321544bca006 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sun, 6 Mar 2016 13:00:58 -0500 Subject: [PATCH] Run pyformat with -s 4 --force_quote_type=single. --- utils/update_build_version.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/update_build_version.py b/utils/update_build_version.py index c93fab575..0194c3eb1 100755 --- a/utils/update_build_version.py +++ b/utils/update_build_version.py @@ -32,6 +32,7 @@ import sys OUTFILE = 'build-version.inc' + def command_output(cmd, dir): """Runs a command in a directory and returns its standard output stream. @@ -44,8 +45,8 @@ def command_output(cmd, dir): stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, _) = p.communicate() - if p.returncode !=0: - raise RuntimeError("Failed to run %s in %s" % (cmd, dir)) + if p.returncode != 0: + raise RuntimeError('Failed to run %s in %s' % (cmd, dir)) return stdout @@ -56,10 +57,10 @@ def describe(dir): Runs 'git describe', or alternately 'git rev-parse HEAD', in dir. If successful, returns the output; otherwise returns 'unknown hash, '.""" try: - return command_output(["git", "describe"], dir).rstrip() + return command_output(['git', 'describe'], dir).rstrip() except: try: - return command_output(["git", "rev-parse", "HEAD"], dir).rstrip() + return command_output(['git', 'rev-parse', 'HEAD'], dir).rstrip() except: return 'unknown hash, ' + datetime.date.today().isoformat()