Skip to content

Commit 8a5265b

Browse files
Correct build error
1 parent 2f47a44 commit 8a5265b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/french_core_smoke.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import importlib.util
22
import pathlib
3+
import sys
4+
import types
35

46

57
ROOT = pathlib.Path(__file__).resolve().parents[1]
68
GENERATED = ROOT / "public" / "generated" / "automate_universel.py"
9+
GENERATED_DIR = GENERATED.parent
10+
GRADIENT_MODULE = "dégradés_couleur"
711

812

913
def load_core():
1014
assert GENERATED.exists(), f"generated French core missing: {GENERATED}"
15+
generated_dir = str(GENERATED_DIR)
16+
if generated_dir not in sys.path:
17+
sys.path.insert(0, generated_dir)
18+
if GRADIENT_MODULE not in sys.modules:
19+
# The generated core currently imports this helper even though the smoke
20+
# tested code paths do not use it.
21+
sys.modules[GRADIENT_MODULE] = types.ModuleType(GRADIENT_MODULE)
1122
spec = importlib.util.spec_from_file_location("automate_universel_generated", GENERATED)
1223
module = importlib.util.module_from_spec(spec)
1324
spec.loader.exec_module(module)

0 commit comments

Comments
 (0)