Skip to content

Commit

Permalink
[FIX] module finder path parameter should be optional
Browse files Browse the repository at this point in the history
According to PEP302, the signature of `Finder.find_module` should be 
`find_module(fullname, path=None)`.

Ever since it was introduced in 64ec5f3 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 odoo#10670
  • Loading branch information
xmo-odoo committed Jan 29, 2016
1 parent ca7983a commit edeb5a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openerp/modules/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit edeb5a8

Please sign in to comment.