🛠️ Fixed check if app is running from source code.
This commit is contained in:
@@ -97,14 +97,14 @@ def is_dev_env() -> bool:
|
|||||||
package_name: str = name_package()
|
package_name: str = name_package()
|
||||||
result: bool = False
|
result: bool = False
|
||||||
|
|
||||||
# Check if package is running from source code == dev mode
|
# Check if package is running from source code == dev mode
|
||||||
# If package is not running in PyInstaller environment.
|
# If package is not running in PyInstaller environment.
|
||||||
if getattr(sys, "frozen", True) and not hasattr(sys, "_MEIPASS"):
|
if not getattr(sys, "frozen", False) and not hasattr(sys, "_MEIPASS"):
|
||||||
try:
|
try:
|
||||||
importlib.metadata.version(package_name)
|
importlib.metadata.version(package_name)
|
||||||
except:
|
except:
|
||||||
# If package is not installed
|
# If package is not installed
|
||||||
result = False
|
result = True
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user