mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-29 03:01:08 +00:00
Run pyformat with -s 4 --force_quote_type=single.
This commit is contained in:
parent
703b0f7ab4
commit
c15683906c
@ -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, <date>'."""
|
||||
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user