Skip to content

Commit

Permalink
Fix some importlib usages (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Nov 1, 2023
1 parent d131732 commit 4722923
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions isapi/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
_DEFAULT_ENABLE_DIR_BROWSING = False
_DEFAULT_ENABLE_DEFAULT_DOC = False

_extensions = [ext for ext, _, _ in importlib.machinery.EXTENSION_SUFFIXES]
is_debug_build = "_d.pyd" in _extensions

this_dir = os.path.abspath(os.path.dirname(__file__))


Expand Down Expand Up @@ -504,9 +501,7 @@ def DeleteExtensionFileRecords(params, options):


def CheckLoaderModule(dll_name):
suffix = ""
if is_debug_build:
suffix = "_d"
suffix = "_d" if "_d.pyd" in importlib.machinery.EXTENSION_SUFFIXES else ""
template = os.path.join(this_dir, "PyISAPI_loader" + suffix + ".dll")
if not os.path.isfile(template):
raise ConfigurationError(f"Template loader '{template}' does not exist")
Expand Down
2 changes: 1 addition & 1 deletion win32/Lib/win32serviceutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# when things go wrong - eg, not enough permissions to hit the
# registry etc.

import importlib
import importlib.machinery
import os
import sys
import warnings
Expand Down

0 comments on commit 4722923

Please sign in to comment.