fixtures: tracker generators load _tracker by path (tools/fixtures/ on sys.path shadowed xml with xml.py)
This commit is contained in:
1 parent
8311620631
commit
4a9ca949e6
4 files changed
+32
-8
No files matched your search
@@ -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"]
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user