@@ -102,64 +102,6 @@ def __init__(self, path):
102
102
self .prefix += path_sep
103
103
104
104
105
- # Check whether we can satisfy the import of the module named by
106
- # 'fullname', or whether it could be a portion of a namespace
107
- # package. Return self if we can load it, a string containing the
108
- # full path if it's a possible namespace portion, None if we
109
- # can't load it.
110
- def find_loader (self , fullname , path = None ):
111
- """find_loader(fullname, path=None) -> self, str or None.
112
-
113
- Search for a module specified by 'fullname'. 'fullname' must be the
114
- fully qualified (dotted) module name. It returns the zipimporter
115
- instance itself if the module was found, a string containing the
116
- full path name if it's possibly a portion of a namespace package,
117
- or None otherwise. The optional 'path' argument is ignored -- it's
118
- there for compatibility with the importer protocol.
119
-
120
- Deprecated since Python 3.10. Use find_spec() instead.
121
- """
122
- _warnings .warn ("zipimporter.find_loader() is deprecated and slated for "
123
- "removal in Python 3.12; use find_spec() instead" ,
124
- DeprecationWarning )
125
- mi = _get_module_info (self , fullname )
126
- if mi is not None :
127
- # This is a module or package.
128
- return self , []
129
-
130
- # Not a module or regular package. See if this is a directory, and
131
- # therefore possibly a portion of a namespace package.
132
-
133
- # We're only interested in the last path component of fullname
134
- # earlier components are recorded in self.prefix.
135
- modpath = _get_module_path (self , fullname )
136
- if _is_dir (self , modpath ):
137
- # This is possibly a portion of a namespace
138
- # package. Return the string representing its path,
139
- # without a trailing separator.
140
- return None , [f'{ self .archive } { path_sep } { modpath } ' ]
141
-
142
- return None , []
143
-
144
-
145
- # Check whether we can satisfy the import of the module named by
146
- # 'fullname'. Return self if we can, None if we can't.
147
- def find_module (self , fullname , path = None ):
148
- """find_module(fullname, path=None) -> self or None.
149
-
150
- Search for a module specified by 'fullname'. 'fullname' must be the
151
- fully qualified (dotted) module name. It returns the zipimporter
152
- instance itself if the module was found, or None if it wasn't.
153
- The optional 'path' argument is ignored -- it's there for compatibility
154
- with the importer protocol.
155
-
156
- Deprecated since Python 3.10. Use find_spec() instead.
157
- """
158
- _warnings .warn ("zipimporter.find_module() is deprecated and slated for "
159
- "removal in Python 3.12; use find_spec() instead" ,
160
- DeprecationWarning )
161
- return self .find_loader (fullname , path )[0 ]
162
-
163
105
def find_spec (self , fullname , target = None ):
164
106
"""Create a ModuleSpec for the specified module.
165
107
0 commit comments