@@ -1368,7 +1368,38 @@ Removed
1368
1368
* The :mod: `!imp ` module has been removed. (Contributed by Barry Warsaw in
1369
1369
:gh: `98040 `.)
1370
1370
1371
- * Replace ``imp.new_module(name) `` with ``types.ModuleType(name) ``.
1371
+ * Replace removed :mod: `!imp ` functions with :mod: `importlib ` functions:
1372
+
1373
+ ================================= =======================================
1374
+ imp importlib
1375
+ ================================= =======================================
1376
+ ``imp.NullImporter `` Insert ``None `` into ``sys.path_importer_cache ``
1377
+ ``imp.cache_from_source() `` :func: `importlib.util.cache_from_source `
1378
+ ``imp.find_module() `` :func: `importlib.util.find_spec `
1379
+ ``imp.get_magic() `` :attr: `importlib.util.MAGIC_NUMBER `
1380
+ ``imp.get_suffixes() `` :attr: `importlib.machinery.SOURCE_SUFFIXES `, :attr: `importlib.machinery.EXTENSION_SUFFIXES `, and :attr: `importlib.machinery.BYTECODE_SUFFIXES `
1381
+ ``imp.get_tag() `` :attr: `sys.implementation.cache_tag <sys.implementation> `
1382
+ ``imp.load_module() `` :func: `importlib.import_module `
1383
+ ``imp.new_module(name) `` ``types.ModuleType(name) ``
1384
+ ``imp.reload() `` :func: `importlib.reload `
1385
+ ``imp.source_from_cache() `` :func: `importlib.util.source_from_cache `
1386
+ ================================= =======================================
1387
+
1388
+ * Removed :mod: `!imp ` functions and attributes with no replacements:
1389
+
1390
+ * undocumented functions:
1391
+
1392
+ * ``imp.init_builtin() ``
1393
+ * ``imp.load_compiled() ``
1394
+ * ``imp.load_dynamic() ``
1395
+ * ``imp.load_package() ``
1396
+ * ``imp.load_source() ``
1397
+
1398
+ * ``imp.lock_held() ``, ``imp.acquire_lock() ``, ``imp.release_lock() ``:
1399
+ the locking scheme has changed in Python 3.3 to per-module locks.
1400
+ * ``imp.find_module() `` constants: ``SEARCH_ERROR ``, ``PY_SOURCE ``,
1401
+ ``PY_COMPILED ``, ``C_EXTENSION ``, ``PY_RESOURCE ``, ``PKG_DIRECTORY ``,
1402
+ ``C_BUILTIN ``, ``PY_FROZEN ``, ``PY_CODERESOURCE ``, ``IMP_HOOK ``.
1372
1403
1373
1404
* Removed the ``suspicious `` rule from the documentation Makefile, and
1374
1405
removed ``Doc/tools/rstlint.py ``, both in favor of `sphinx-lint
0 commit comments