[utils] Add helper to determine if running PyInstaller package

This commit is contained in:
derrod 2021-09-05 00:26:05 +02:00
parent 39bfa3df15
commit 43bb09a1ad

10
legendary/utils/env.py Normal file
View file

@ -0,0 +1,10 @@
import os
import sys
def is_pyinstaller():
return getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')
def is_windows_or_pyi():
return is_pyinstaller() or os.name == 'nt'