Skip to content

Commit 03a8bb1

Browse files
authored
Replace usages of the imp module (#2113)
1 parent 4445881 commit 03a8bb1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

com/win32comext/axscript/client/pyscript.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
import re
11+
import types
1112

1213
import pythoncom
1314
import win32api
@@ -210,10 +211,9 @@ def __init__(self):
210211

211212
def InitNew(self):
212213
framework.COMScript.InitNew(self)
213-
import imp
214214

215215
self.scriptDispatch = None
216-
self.globalNameSpaceModule = imp.new_module("__ax_main__")
216+
self.globalNameSpaceModule = types.ModuleType("__ax_main__")
217217
self.globalNameSpaceModule.__dict__["ax"] = AXScriptAttribute(self)
218218

219219
self.codeBlocks = []

isapi/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# this code adapted from "Tomcat JK2 ISAPI redirector", part of Apache
44
# Created July 2004, Mark Hammond.
5-
import imp
5+
import importlib.machinery
66
import os
77
import shutil
88
import stat
@@ -39,7 +39,7 @@
3939
_DEFAULT_ENABLE_DIR_BROWSING = False
4040
_DEFAULT_ENABLE_DEFAULT_DOC = False
4141

42-
_extensions = [ext for ext, _, _ in imp.get_suffixes()]
42+
_extensions = [ext for ext, _, _ in importlib.machinery.EXTENSION_SUFFIXES]
4343
is_debug_build = "_d.pyd" in _extensions
4444

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

0 commit comments

Comments
 (0)