Skip to content

Commit a2a73f3

Browse files
committed
unset PYTHONIOENCODING when we check if preinitialized context works
1 parent 7744689 commit a2a73f3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,12 @@ def find_eclipse():
824824
def set_env(**environ):
825825
"""Temporarily set the process environment variables"""
826826
old_environ = dict(os.environ)
827-
os.environ.update(environ)
827+
for k, v in environ.items():
828+
if v is None:
829+
if k in os.environ:
830+
del os.environ[k]
831+
else:
832+
os.environ[k] = v
828833
try:
829834
yield
830835
finally:
@@ -1553,10 +1558,11 @@ def graalpython_gate_runner(args, tasks):
15531558

15541559
with Task('GraalPython GraalVM build', tasks, tags=[GraalPythonTags.svm, GraalPythonTags.graalvm], report=True) as task:
15551560
if task:
1556-
svm_image = python_svm()
1557-
benchmark = os.path.join(PATH_MESO, "image-magix.py")
1558-
out = mx.OutputCapture()
1559-
mx.run([svm_image, "-v", "-S", "--log.python.level=FINEST", benchmark], nonZeroIsFatal=True, out=mx.TeeOutputCapture(out), err=mx.TeeOutputCapture(out))
1561+
with set_env(PYTHONIOENCODING=None):
1562+
svm_image = python_svm()
1563+
benchmark = os.path.join(PATH_MESO, "image-magix.py")
1564+
out = mx.OutputCapture()
1565+
mx.run([svm_image, "-v", "-S", "--log.python.level=FINEST", benchmark], nonZeroIsFatal=True, out=mx.TeeOutputCapture(out), err=mx.TeeOutputCapture(out))
15601566
success = "\n".join([
15611567
"[0, 0, 0, 0, 0, 0, 10, 10, 10, 0, 0, 10, 3, 10, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0]",
15621568
])

0 commit comments

Comments
 (0)