mirror of
https://github.com/niess/python-appimage.git
synced 2026-03-15 04:40:15 +01:00
Patch _initappimage for 3.11
This commit is contained in:
19
python_appimage/data/_initappimage.py
Normal file
19
python_appimage/data/_initappimage.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# This is a patch to getpath. It must execute before site.main() is called
|
||||
def _initappimage():
|
||||
"""Initialise executable name when running from an AppImage."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
env = os.environ
|
||||
try:
|
||||
command = env["APPIMAGE_COMMAND"]
|
||||
except KeyError:
|
||||
return
|
||||
|
||||
if command and ("APPDIR" in env):
|
||||
command = os.path.abspath(command)
|
||||
sys.executable = command
|
||||
sys._base_executable = command
|
||||
|
||||
_initappimage()
|
||||
del _initappimage
|
||||
Reference in New Issue
Block a user