Files
PDF-Downloaders/Scribd/build/runtime_hook.py
T
2026-05-15 10:44:57 -04:00

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")