Browse files

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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 723b574 commit 4c5c8dca315058e2400104be0438af22a3ed61cf @alex alex committed Jul 10, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/utils/
@@ -12,7 +12,7 @@ def module_has_submodule(package, module_name):
except KeyError:
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.

0 comments on commit 4c5c8dc

Please sign in to comment.