Googletest export

Make generating goldens work with Python 3

golden_file.write(output) fails with Python 3 with:
TypeError: a bytes-like object is required, not 'str'
PiperOrigin-RevId: 282316101
This commit is contained in:
Abseil Team 2019-11-25 05:29:35 -05:00 committed by Gennadiy Rozental
parent 679bfec6db
commit 51545ee515

View File

@ -331,7 +331,7 @@ if __name__ == '__main__':
if CAN_GENERATE_GOLDEN_FILE:
output = GetOutputOfAllCommands()
golden_file = open(GOLDEN_PATH, 'wb')
golden_file.write(output)
golden_file.write(output.encode())
golden_file.close()
else:
message = (