1
0
mirror of https://github.com/django/django.git synced 2024-12-25 02:26:12 +00:00

Properly implement PEP 302 in the module_loading module. For unknown reasons this doesn't actually raise an error under CPython, but PyPy does, and the currently implementation is clearly in violation of the PEP, which states that finder.find_module's second argument is either None or package.__path__ and imp.find_module whose second argument should be either None or a list of paths.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2011-07-10 20:01:12 +00:00
parent 723b574793
commit 4c5c8dca31

View File

@ -12,7 +12,7 @@ def module_has_submodule(package, module_name):
except KeyError:
pass
for finder in sys.meta_path:
if finder.find_module(name, package):
if finder.find_module(name, package.__path__):
return True
for entry in package.__path__: # No __path__, then not a package.
try: