Fix extract tests on windows.

This commit is contained in:
chriseth
2020-01-23 16:36:46 +01:00
parent 3add37a2c9
commit 8f36dd1571
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import sys
import re
def extract_test_cases(_path):
lines = open(_path, 'rb').read().splitlines()
lines = open(_path, mode='rb', encoding='utf8').read().splitlines()
inside = False
delimiter = ''
@@ -22,7 +22,7 @@ def extract_test_cases(_path):
for l in lines:
if inside:
if l.strip().endswith(')' + delimiter + '";'):
open('%03d_%s.sol' % (ctr, test_name), 'wb').write(test)
open('%03d_%s.sol' % (ctr, test_name), mode='wb', encoding='utf8').write(test)
ctr += 1
inside = False
test = ''