Skip to content

useless code in zipimport can be dropped #140324

Description

@yihong0618

the function load_module drop in patch https://github.com/python/cpython/pull/133662/files

but forgot to drop the _module_type

diff --git a/Lib/zipimport.py b/Lib/zipimport.py
index 188c4bca97..7311daf2b8 100644
--- a/Lib/zipimport.py
+++ b/Lib/zipimport.py
@@ -18,7 +18,6 @@
 import _imp  # for check_hash_based_pycs
 import _io  # for open
 import marshal  # for loads
-import sys  # for modules
 import time  # for mktime
 
 __all__ = ['ZipImportError', 'zipimporter']
@@ -34,8 +33,6 @@ class ZipImportError(ImportError):
 # _read_directory() cache
 _zip_directory_cache = {}
 
-_module_type = type(sys)
-
 END_CENTRAL_DIR_SIZE = 22
 END_CENTRAL_DIR_SIZE_64 = 56
 END_CENTRAL_DIR_LOCATOR_SIZE_64 = 20

Linked PRs

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-refactorCode refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions