From 39449ac581b53cf3d4768b0bab9c42d046df910e Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sun, 5 Jan 2025 18:36:35 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20PyInstaller=20binary=20detection?= =?UTF-8?q?=20replaced=20with=20Nuitka's=20version.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/__init__.py | 6 +++--- 1 file 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: