Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pywin32_bootstrap.py 1.3KB

1 year ago
1234567891011121314151617181920212223242526272829
  1. # Imported by pywin32.pth to bootstrap the pywin32 environment in "portable"
  2. # environments or any other case where the post-install script isn't run.
  3. #
  4. # In short, there's a directory installed by pywin32 named 'pywin32_system32'
  5. # with some important DLLs which need to be found by Python when some pywin32
  6. # modules are imported.
  7. # If Python has `os.add_dll_directory()`, we need to call it with this path.
  8. # Otherwise, we add this path to PATH.
  9. try:
  10. import pywin32_system32
  11. except ImportError: # Python ≥3.6: replace ImportError with ModuleNotFoundError
  12. pass
  13. else:
  14. import os
  15. # We're guaranteed only that __path__: Iterable[str]
  16. # https://docs.python.org/3/reference/import.html#__path__
  17. for path in pywin32_system32.__path__:
  18. if os.path.isdir(path):
  19. if hasattr(os, "add_dll_directory"):
  20. os.add_dll_directory(path)
  21. # This is to ensure the pywin32 path is in the beginning to find the
  22. # pywin32 DLLs first and prevent other PATH entries to shadow them
  23. elif not os.environ["PATH"].startswith(path):
  24. os.environ["PATH"] = os.environ["PATH"].replace(os.pathsep + path, "")
  25. os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]
  26. break