Skip to content

Commit 755818b

Browse files
committed
Drop _NAMESPACE constant
Signed-off-by: Filipe Laíns <[email protected]>
1 parent 87f9edb commit 755818b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/modulefinder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
_PKG_DIRECTORY = 5
1818
_C_BUILTIN = 6
1919
_PY_FROZEN = 7
20-
_NAMESPACE = 8
2120

2221
# Modulefinder does a good job at simulating Python's, but it can not
2322
# handle __path__ modifications packages make at runtime. Therefore there
@@ -68,7 +67,7 @@ def _find_module(name, path=None):
6867
file_path = spec.origin
6968

7069
if isinstance(spec.loader, importlib.machinery.NamespaceLoader):
71-
return None, spec.submodule_search_locations, ("", "", _NAMESPACE)
70+
return None, spec.submodule_search_locations, ("", "", _PKG_DIRECTORY)
7271

7372
if spec.loader.is_package(name): # non-namespace package
7473
return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY)
@@ -333,7 +332,7 @@ def import_module(self, partname, fqname, parent):
333332
def load_module(self, fqname, fp, pathname, file_info):
334333
suffix, mode, type = file_info
335334
self.msgin(2, "load_module", fqname, fp and "fp", pathname)
336-
if type in (_PKG_DIRECTORY, _NAMESPACE):
335+
if type == _PKG_DIRECTORY:
337336
m = self.load_package(fqname, pathname)
338337
self.msgout(2, "load_module ->", m)
339338
return m

0 commit comments

Comments
 (0)