mozjs68/jstests_python-3.patch

58 lines
2.3 KiB
Diff
Raw Normal View History

2019-11-12 22:39:31 +00:00
From e75a1c531767f3efd158fd8309084cf5157307be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Tue, 5 Nov 2019 19:14:38 +0100
Subject: [PATCH] Python 3
---
js/src/jit-test/jit_test.py | 2 +-
js/src/tests/lib/manifest.py | 5 ++++-
js/src/tests/lib/tasks_unix.py | 3 +++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py
index 8fcd0c5..f51c544 100755
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -138,7 +138,7 @@ def main(argv):
help='With --write-failures=FILE, additionally write the'
' output of failed tests to [FILE]')
op.add_option('--jitflags', dest='jitflags', default='none',
- choices=valid_jitflags(),
+ choices=list(valid_jitflags()),
help='IonMonkey option combinations. One of %s.' % ', '.join(valid_jitflags()))
op.add_option('--ion', dest='jitflags', action='store_const', const='ion',
help='Run tests once with --ion-eager and once with'
diff --git a/js/src/tests/lib/manifest.py b/js/src/tests/lib/manifest.py
index 617f0f1..f54cc1e 100644
--- a/js/src/tests/lib/manifest.py
+++ b/js/src/tests/lib/manifest.py
@@ -105,7 +105,10 @@ class XULInfoTester:
'-e', self.js_prologue,
'-e', 'print(!!({}))'.format(cond)
]
- p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ try:
+ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, encoding="utf-8")
+ except TypeError:
+ p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
out, err = p.communicate()
if out in ('true\n', 'true\r\n'):
ans = True
diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
index 40528b8..5edfe92 100644
--- a/js/src/tests/lib/tasks_unix.py
+++ b/js/src/tests/lib/tasks_unix.py
@@ -182,6 +182,9 @@ def reap_zombies(tasks, timeout):
if os.WIFSIGNALED(status):
returncode = -os.WTERMSIG(status)
+ ended.out=[x.decode('utf-8') for x in ended.out]
+ ended.err=[x.decode('utf-8') for x in ended.err]
+
finished.append(
TestOutput(
ended.test,
--
2.23.0