Skip to content

Commit 10d6289

Browse files
committed
delete ssl affecting keys from environment before running python
1 parent c6b3797 commit 10d6289

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ def _extract_graalpython_internal_options(args):
114114
return non_internal, additional_dists
115115

116116

117+
def delete_bad_env_keys(env):
118+
for k in ["SSL_CERT_FILE", "REQUESTS_CA_BUNDLE"]:
119+
if k in env:
120+
del env[k]
121+
122+
117123
def check_vm(vm_warning=True, must_be_jvmci=False):
118124
if not SUITE_COMPILER:
119125
if must_be_jvmci:
@@ -156,6 +162,7 @@ def do_run_python(args, extra_vm_args=None, env=None, jdk=None, extra_dists=None
156162
if not env:
157163
env = os.environ.copy()
158164
env.setdefault("GRAAL_PYTHONHOME", _dev_pythonhome())
165+
delete_bad_env_keys(env)
159166

160167
check_vm_env = env.get('GRAALPYTHON_MUST_USE_GRAAL', False)
161168
if check_vm_env:
@@ -297,10 +304,12 @@ def run_cpython_test(args):
297304
for g in globs:
298305
testfiles += glob.glob(os.path.join(SUITE.dir, "graalpython/lib-python/3/test", "%s*" % g))
299306
interp_args.insert(0, "--python.CAPI=%s" % _get_capi_home())
307+
env = os.environ.copy()
308+
delete_bad_env_keys(env)
300309
with _dev_pythonhome_context():
301310
mx.run([python_gvm_with_assertions()] + interp_args + [
302311
os.path.join(SUITE.dir, "graalpython/com.oracle.graal.python.test/src/tests/run_cpython_test.py"),
303-
] + test_args + testfiles)
312+
] + test_args + testfiles, env=env)
304313

305314

306315
def retag_unittests(args):
@@ -316,6 +325,7 @@ def retag_unittests(args):
316325
ENABLE_CPYTHON_TAGGED_UNITTESTS="true",
317326
PYTHONPATH=os.path.join(_dev_pythonhome(), 'lib-python/3'),
318327
)
328+
delete_bad_env_keys(env)
319329
args = [
320330
'--experimental-options=true',
321331
'--python.CatchAllExceptions=true',
@@ -625,6 +635,7 @@ def graalpytest(args):
625635
cmd_args += ["-k", args.filter]
626636
env = os.environ.copy()
627637
env['PYTHONHASHSEED'] = '0'
638+
delete_bad_env_keys(env)
628639
if args.python:
629640
return mx.run([args.python] + cmd_args, nonZeroIsFatal=True, env=env)
630641
else:
@@ -669,6 +680,7 @@ def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=Fa
669680
if env is None:
670681
env = os.environ.copy()
671682
env['PYTHONHASHSEED'] = '0'
683+
delete_bad_env_keys(env)
672684

673685
# list of excluded tests
674686
if aot_compatible:
@@ -742,6 +754,7 @@ def run_hpy_unittests(python_binary, args=None):
742754
env = os.environ.copy()
743755
prefix = str(d)
744756
env.update(PYTHONUSERBASE=prefix)
757+
delete_bad_env_keys(env)
745758
mx.run_mx(["build", "--dependencies", "LLVM_TOOLCHAIN"])
746759
env.update(LLVM_TOOLCHAIN_VANILLA=mx_subst.path_substitutions.substitute('<path:LLVM_TOOLCHAIN>/bin'))
747760
mx.log("LLVM Toolchain (vanilla): {!s}".format(env["LLVM_TOOLCHAIN_VANILLA"]))

0 commit comments

Comments
 (0)