mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-07-01 10:51:07 +03:00
+4
-1
@@ -25,7 +25,10 @@ class LocaleEnum(str, Enum):
|
||||
return _DEFAULT_LOCALE
|
||||
|
||||
|
||||
_LOCALES_DIR = Path(__file__).resolve().parent
|
||||
try:
|
||||
_LOCALES_DIR = Path(__file__).resolve(strict=False).parent
|
||||
except OSError:
|
||||
_LOCALES_DIR = Path(os.path.realpath(__file__)).parent
|
||||
_DEFAULT_LOCALE = LocaleEnum.english
|
||||
|
||||
_translations: Dict[str, str] = {}
|
||||
|
||||
@@ -41,7 +41,10 @@ def _exe_dir() -> Optional[Path]:
|
||||
return None
|
||||
if not base:
|
||||
return None
|
||||
p = Path(base).resolve()
|
||||
try:
|
||||
p = Path(base).resolve(strict=False)
|
||||
except OSError:
|
||||
p = Path(os.path.realpath(base))
|
||||
return p.parent if p.is_file() else p
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user