From f6d6f5b6084c0b9b501a4d0f8d873f9a6a099e92 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sat, 13 Jul 2024 09:33:17 -0700 Subject: [PATCH] Ensure emscripten root is at the start of python path (#22230) This avoids issues where something called e.g. `tools` already exists in the python path. See https://github.com/emscripten-core/emsdk/issues/1420#issuecomment-2226178120 --- test/benchmark/benchmark_sse.py | 2 +- test/runner.py | 2 +- tools/maint/check_struct_info.py | 2 +- tools/maint/create_release.py | 2 +- tools/maint/update_settings_docs.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/benchmark/benchmark_sse.py b/test/benchmark/benchmark_sse.py index b95b8cdf7c6bd..28b75dbbd8200 100644 --- a/test/benchmark/benchmark_sse.py +++ b/test/benchmark/benchmark_sse.py @@ -13,7 +13,7 @@ from subprocess import Popen __rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append(__rootpath__) +sys.path.insert(0, __rootpath__) from tools.shared import WINDOWS, CLANG_CXX, EMCC, PIPE from tools.shared import run_process diff --git a/test/runner.py b/test/runner.py index 5a86a49108a19..92d38f83879c1 100755 --- a/test/runner.py +++ b/test/runner.py @@ -33,7 +33,7 @@ # Setup __rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append(__rootpath__) +sys.path.insert(0, __rootpath__) import jsrun import parallel_testsuite diff --git a/tools/maint/check_struct_info.py b/tools/maint/check_struct_info.py index fe9692472544b..373f7e04c32bd 100755 --- a/tools/maint/check_struct_info.py +++ b/tools/maint/check_struct_info.py @@ -11,7 +11,7 @@ script_dir = os.path.dirname(os.path.abspath(__file__)) root_dir = os.path.dirname(os.path.dirname(script_dir)) -sys.path.append(root_dir) +sys.path.insert(0, root_dir) from tools import utils diff --git a/tools/maint/create_release.py b/tools/maint/create_release.py index 3d3ba655b6bd0..11f57038b6874 100755 --- a/tools/maint/create_release.py +++ b/tools/maint/create_release.py @@ -12,7 +12,7 @@ script_dir = os.path.dirname(os.path.abspath(__file__)) root_dir = os.path.dirname(os.path.dirname(script_dir)) -sys.path.append(root_dir) +sys.path.insert(0, root_dir) from tools import shared, utils diff --git a/tools/maint/update_settings_docs.py b/tools/maint/update_settings_docs.py index dc10f86191e44..bb39d5a2f1cca 100755 --- a/tools/maint/update_settings_docs.py +++ b/tools/maint/update_settings_docs.py @@ -23,7 +23,7 @@ script_dir = os.path.dirname(os.path.abspath(__file__)) root_dir = os.path.dirname(os.path.dirname(script_dir)) -sys.path.append(root_dir) +sys.path.insert(0, root_dir) from tools.utils import path_from_root, read_file, safe_ensure_dirs