Skip to content

Commit 4c7cd84

Browse files
committed
[DEBUG] Try manual patch for __main__ again
Signed-off-by: Cristian Le <[email protected]>
1 parent 1c73be5 commit 4c7cd84

File tree

1 file changed

+10
-0
lines changed
  • tests/packages/repair_wheel/python/repair_wheel

1 file changed

+10
-0
lines changed

tests/packages/repair_wheel/python/repair_wheel/__main__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import platform
34
import subprocess
45
import sys
56
from pathlib import Path
@@ -8,6 +9,15 @@
89
def run() -> None:
910
exe_path = Path(__file__).parent
1011
exe_path = next((exe_path / "bin").glob("main*"))
12+
print(f"[Before] sys.path = {sys.path}")
13+
if platform.system() == "Windows":
14+
import os
15+
16+
base_project_bindir = Path(__file__).parent / "../base_project/bin"
17+
project_bindir = Path(__file__).parent / "bin"
18+
os.add_dll_directory(str(base_project_bindir)) # type: ignore[attr-defined]
19+
os.add_dll_directory(str(project_bindir)) # type: ignore[attr-defined]
20+
print(f"[After] sys.path = {sys.path}")
1121
sys.exit(subprocess.call([str(exe_path), *sys.argv[2:]]))
1222

1323

0 commit comments

Comments
 (0)