Skip to content
Snippets Groups Projects
Commit edeb5a8c authored by Xavier Morel's avatar Xavier Morel
Browse files

[FIX] module finder path parameter should be optional

According to PEP302, the signature of `Finder.find_module` should be 
`find_module(fullname, path=None)`.

Ever since it was introduced in 64ec5f36 the addons import hook 
defines the second parameter as mandatory, which is an issue for
systems relying on the specified behaviour (and not needing to
provide a path) like the stdlib's `pkgutil.find_loader`.

fixes #10670
parent ca7983a4
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class AddonsImportHook(object):
thus `import openerp.addons.module`.
"""
def find_module(self, module_name, package_path):
def find_module(self, module_name, package_path=None):
module_parts = module_name.split('.')
if len(module_parts) == 3 and module_name.startswith('openerp.addons.'):
return self # We act as a loader too.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment