Update tests and CI to python3 (#5095)
Update debugger and test262 tests to python3 Disable CI jobs that need ubuntu-18.04 (EOL) until they are updated JerryScript-DCO-1.0-Signed-off-by: Máté Tokodi matet@inf.u-szeged.hu
This commit is contained in:
@@ -26,7 +26,7 @@ import util
|
||||
def get_platform_cmd_prefix():
|
||||
if sys.platform == 'win32':
|
||||
return ['cmd', '/S', '/C']
|
||||
return ['python2'] # The official test262.py isn't python3 compatible, but has python shebang.
|
||||
return ['python3']
|
||||
|
||||
|
||||
def get_arguments():
|
||||
|
||||
@@ -402,13 +402,11 @@ class TempFile(object):
|
||||
text=self.text)
|
||||
|
||||
def write(self, string):
|
||||
os.write(self.file_desc, string)
|
||||
os.write(self.file_desc, string.encode('utf8'))
|
||||
|
||||
def read(self):
|
||||
file_desc = file(self.name)
|
||||
result = file_desc.read()
|
||||
file_desc.close()
|
||||
return result
|
||||
with open(self.name, "r", newline='') as file_desc:
|
||||
return file_desc.read()
|
||||
|
||||
def close(self):
|
||||
if not self.is_closed:
|
||||
@@ -495,7 +493,7 @@ class TestCase(object):
|
||||
self.name = name
|
||||
self.full_path = full_path
|
||||
self.strict_mode = strict_mode
|
||||
with open(self.full_path, "rb") as file_desc:
|
||||
with open(self.full_path, "r", newline='') as file_desc:
|
||||
self.contents = file_desc.read()
|
||||
test_record = parse_test_record(self.contents, name)
|
||||
self.test = test_record["test"]
|
||||
|
||||
Reference in New Issue
Block a user