Skip to content

Commit

Permalink
Fix SyntaxWarning in Python 3.8 (KhronosGroup#3388)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb authored Jul 27, 2020
1 parent 6aed7ff commit b63f0e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/tools/spirv_test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@ def __init__(self, test_manager, returncode, stdout, stderr, directory,
# Some of our MacOS bots still run Python 2, so need to be backwards
# compatible here.
if type(stdout) is not str:
if sys.version_info[0] is 2:
if sys.version_info[0] == 2:
self.stdout = stdout.decode('utf-8')
elif sys.version_info[0] is 3:
elif sys.version_info[0] == 3:
self.stdout = str(stdout, encoding='utf-8') if stdout is not None else stdout
else:
raise Exception('Unable to determine if running Python 2 or 3 from {}'.format(sys.version_info))
else:
self.stdout = stdout

if type(stderr) is not str:
if sys.version_info[0] is 2:
if sys.version_info[0] == 2:
self.stderr = stderr.decode('utf-8')
elif sys.version_info[0] is 3:
elif sys.version_info[0] == 3:
self.stderr = str(stderr, encoding='utf-8') if stderr is not None else stderr
else:
raise Exception('Unable to determine if running Python 2 or 3 from {}'.format(sys.version_info))
Expand Down

0 comments on commit b63f0e5

Please sign in to comment.