fixtures: tracker generators load _tracker by path (tools/fixtures/ on sys.path shadowed xml with xml.py)

This commit is contained in:
4DBug committed 2026-10-31 09:34:04 -05:00
1 parent 8311620631
commit 4a9ca949e6
4 files changed
+32 -8

No files matched your search

+8 -2
View File
@@ -5,8 +5,14 @@
# duration (openmpt's song length), plain (for "compressed": the same song uncompressed) }
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import _tracker as T # noqa: E402
# the shared tracker module, loaded by path (tools/fixtures/ must not go on sys.path: xml.py there would shadow xml)
T = sys.modules.get("_tracker")
if T is None:
import importlib.util
_spec = importlib.util.spec_from_file_location("_tracker", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_tracker.py"))
T = importlib.util.module_from_spec(_spec)
sys.modules["_tracker"] = T
_spec.loader.exec_module(T)
INPUTS = ["tools/fixtures/_tracker.py"]
+8 -2
View File
@@ -3,8 +3,14 @@
# duration (openmpt's song length) }
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import _tracker as T # noqa: E402
# the shared tracker module, loaded by path (tools/fixtures/ must not go on sys.path: xml.py there would shadow xml)
T = sys.modules.get("_tracker")
if T is None:
import importlib.util
_spec = importlib.util.spec_from_file_location("_tracker", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_tracker.py"))
T = importlib.util.module_from_spec(_spec)
sys.modules["_tracker"] = T
_spec.loader.exec_module(T)
INPUTS = ["tools/fixtures/_tracker.py"]
+8 -2
View File
@@ -3,8 +3,14 @@
# duration (openmpt's song length) }
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import _tracker as T # noqa: E402
# the shared tracker module, loaded by path (tools/fixtures/ must not go on sys.path: xml.py there would shadow xml)
T = sys.modules.get("_tracker")
if T is None:
import importlib.util
_spec = importlib.util.spec_from_file_location("_tracker", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_tracker.py"))
T = importlib.util.module_from_spec(_spec)
sys.modules["_tracker"] = T
_spec.loader.exec_module(T)
INPUTS = ["tools/fixtures/_tracker.py"]
+8 -2
View File
@@ -4,8 +4,14 @@
# duration (openmpt's song length) }
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import _tracker as T # noqa: E402
# the shared tracker module, loaded by path (tools/fixtures/ must not go on sys.path: xml.py there would shadow xml)
T = sys.modules.get("_tracker")
if T is None:
import importlib.util
_spec = importlib.util.spec_from_file_location("_tracker", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_tracker.py"))
T = importlib.util.module_from_spec(_spec)
sys.modules["_tracker"] = T
_spec.loader.exec_module(T)
INPUTS = ["tools/fixtures/_tracker.py"]