Skip to content
Closed
Prev Previous commit
Add backwards compatibility with namespace packages
  • Loading branch information
ZeroIntensity committed Jun 29, 2024
commit a9c8e28827a3e1aef40628bc222f6f6e7eff533f
2 changes: 1 addition & 1 deletion Lib/zipimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _get_module_path(self, fullname):
# Originally, this *only* used rpartition('.')[2] to find
# the last item in a namespace package, but that made it basically
# impossible to use nested submodules.
for suffix, _, _ in _zip_searchorder:
for suffix, _, _ in [*_zip_searchorder, (path_sep, False, False)]:
if (path + suffix) in self._get_files():
# OK, we found it the old way. Let's return it.
return path
Expand Down