old_contents: # this is a python script because handling Ctrl+C interrupts in batch
  # scripts seems to be impossible
  #
  # This should always run in the same python that Porcupine uses.
  from __future__ import annotations
  
  import os
  import subprocess
  import sys
  
  import colorama
  
  colorama.init()
  
  # When installed from the exe installer, python finds its modules with
  # PYTHONPATH. We don't want to pass it on to the user's command, because it
  # should run with the user's own Python, not Porcupine's python.
  new_env = dict(os.environ)
  try:
      del new_env["PYTHONPATH"]
  except KeyError:
      pass
  
  prog, directory, command = sys.argv
  print(colorama.Fore.BLUE + command + colorama.Fore.RESET)
  try:
      returncode: int | None = subprocess.call(command, cwd=directory, env=new_env, shell=True)
  except KeyboardInterrupt:
      # the subprocess should have already printed any traceback or
      # whatever it might want to print
      # TODO: try to catch the return code in this case as well?
      returncode = None
  
  print()
  print("-----------------------------")
  if returncode == 0:
      print("The program completed successfully.")
  elif returncode is None:
      print("The program was interrupted.")
  else:
      print(f"The program failed with status {returncode}.")
  
  print("Press Enter to close this window...")
  input()
  
new_contents: # this is a python script because handling Ctrl+C interrupts in batch
  # scripts seems to be impossible
  #
  # This should always run in the same python that Porcupine uses.
  from __future__ import annotations
  
  import subprocess
  import sys
  
  import colorama
  
  colorama.init()
  
  prog, directory, command = sys.argv
  print(colorama.Fore.BLUE + command + colorama.Fore.RESET)
  try:
      returncode: int | None = subprocess.call(command, cwd=directory, shell=True)
  except KeyboardInterrupt:
      # the subprocess should have already printed any traceback or
      # whatever it might want to print
      # TODO: try to catch the return code in this case as well?
      returncode = None
  
  print()
  print("-----------------------------")
  if returncode == 0:
      print("The program completed successfully.")
  elif returncode is None:
      print("The program was interrupted.")
  else:
      print(f"The program failed with status {returncode}.")
  
  print("Press Enter to close this window...")
  input()
  
subject: delete old PYTHONPATH hack (#807)