site-patch.py 449 B

12345678910111213141516
  1. # This is a site.py patch when calling Python from an AppImage.
  2. def _initappimage():
  3. """Initialise executable name for running from an AppImage."""
  4. env = os.environ
  5. try:
  6. command = env["APPIMAGE_COMMAND"]
  7. except KeyError:
  8. return
  9. if command and ("APPDIR" in env):
  10. command = os.path.abspath(command)
  11. sys.executable = command
  12. sys._base_executable = command
  13. _initappimage()
  14. del _initappimage