mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-29 03:01:08 +00:00
Add comments to explain why calling decode().
This commit is contained in:
parent
c15683906c
commit
f7e63786a9
@ -71,6 +71,11 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
new_content = '"spirv-tools {}\\n"\n'.format(
|
||||
# decode() is needed here for Python3 compatibility. In Python2,
|
||||
# str and bytes are the same type, but not in Python3.
|
||||
# Popen.communicate() returns a bytes instance, which needs to be
|
||||
# decoded into text data first in Python3. And this decode() won't
|
||||
# hurt Python2.
|
||||
describe(sys.argv[1]).decode('ascii').replace('"', '\\"'))
|
||||
if os.path.isfile(OUTFILE) and new_content == open(OUTFILE, 'r').read():
|
||||
sys.exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user