diff --git a/test/tools/spirv_test_framework.py b/test/tools/spirv_test_framework.py index 42f83c64ae..542f1446a0 100755 --- a/test/tools/spirv_test_framework.py +++ b/test/tools/spirv_test_framework.py @@ -146,9 +146,9 @@ 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)) @@ -156,9 +156,9 @@ def __init__(self, test_manager, returncode, stdout, stderr, directory, 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))