aboutsummaryrefslogtreecommitdiff
path: root/gen/prop/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'gen/prop/lib.py')
-rw-r--r--gen/prop/lib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gen/prop/lib.py b/gen/prop/lib.py
index b4c7e1e..0912208 100644
--- a/gen/prop/lib.py
+++ b/gen/prop/lib.py
@@ -1,4 +1,7 @@
import functools
+import os
+import sys
+from pathlib import Path
from typing import Generator
def chunks[T](xs: list[T], n: int) -> Generator[list[T], None, None]:
@@ -45,3 +48,7 @@ def typename(x: int) -> str:
if x < 18446744073709551615:
return "uint64_t"
raise ValueError
+
+def cwd_init() -> None:
+ dir = Path(os.path.dirname(sys.argv[0]))
+ os.chdir(dir / '..' / '..')