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:
Máté Tokodi
2023-09-20 15:38:30 +02:00
committed by GitHub
parent 05dbbd134c
commit a588e49661
6 changed files with 87 additions and 94 deletions
+1 -1
View File
@@ -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():
+4 -6
View File
@@ -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"]