GP-0: Fixing pyghidra_launcher.py issue with Python 3.9

This commit is contained in:
Ryan Kurtz
2024-12-18 14:13:04 -05:00
parent 8dd0ea698a
commit a1550766f2
@@ -84,7 +84,14 @@ def in_venv() -> bool:
return sys.prefix != sys.base_prefix return sys.prefix != sys.base_prefix
def is_externally_managed() -> bool: def is_externally_managed() -> bool:
marker: Path = Path(sysconfig.get_path('stdlib', sysconfig.get_default_scheme())) / 'EXTERNALLY-MANAGED' get_default_scheme = 'get_default_scheme'
if hasattr(sysconfig, get_default_scheme):
# Python 3.10 and later
default_scheme = getattr(sysconfig, get_default_scheme)
else:
# Python 3.9
default_scheme = getattr(sysconfig, f'_{get_default_scheme}')
marker: Path = Path(sysconfig.get_path("stdlib", default_scheme())) / 'EXTERNALLY-MANAGED'
return marker.is_file() return marker.is_file()
def get_venv_exe(venv_dir: Path) -> List[str]: def get_venv_exe(venv_dir: Path) -> List[str]: