diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-01-05 18:36:35 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-01-05 18:36:35 +0100 |
| commit | 39449ac581b53cf3d4768b0bab9c42d046df910e (patch) | |
| tree | c52a37ad1ce47cc9db5b959269b9158a386bd377 /tidal_dl_ng/__init__.py | |
| parent | ca6e2b3ef7dfc4441257f530a5df183c15a9d540 (diff) | |
| download | tidal-dl-ng-39449ac581b53cf3d4768b0bab9c42d046df910e.tar.gz | |
👷 PyInstaller binary detection replaced with Nuitka's version.
Diffstat (limited to 'tidal_dl_ng/__init__.py')
| -rw-r--r-- | tidal_dl_ng/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tidal_dl_ng/__init__.py b/tidal_dl_ng/__init__.py index 5fb660b..9037212 100644 --- a/tidal_dl_ng/__init__.py +++ b/tidal_dl_ng/__init__.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import importlib.metadata -import sys from pathlib import Path from urllib.parse import urlparse @@ -98,8 +97,9 @@ def is_dev_env() -> bool: result: bool = False # Check if package is running from source code == dev mode - # If package is not running in PyInstaller environment. - if not getattr(sys, "frozen", False) and not hasattr(sys, "_MEIPASS"): + # If package is not running in Nuitka environment, try to import it from pip libraries. + # If this also fails, it is dev mode. + if "__compiled__" not in globals(): try: importlib.metadata.version(package_name) except: |
