18 lines
392 B
Python
18 lines
392 B
Python
"""PyInstaller runtime hook — configure paths when running as a frozen app."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
|
|
|
|
def _app_dir() -> str:
|
|
if getattr(sys, "frozen", False):
|
|
return os.path.dirname(sys.executable)
|
|
return os.getcwd()
|
|
|
|
|
|
if getattr(sys, "frozen", False):
|
|
os.chdir(_app_dir())
|
|
os.environ.setdefault("PLAYWRIGHT_BROWSERS_PATH", "0")
|