[FIX] module loading: allow addons path entries to have substring of others.

i.e. having ./addons/ and ./addons2/ is now possible

bzr revid: chm@openerp.com-20130307131104-ju2n7zm7yvced68h
This commit is contained in:
Christophe Simonis 2013-03-07 14:11:04 +01:00 committed by Christophe Matthieu
parent 617c03a19c
commit ab2dd715de
1 changed files with 1 additions and 0 deletions

View File

@ -139,6 +139,7 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False):
# Is it below 'addons_path' or 'root_path'?
name = os.path.normcase(os.path.normpath(name))
for root in adps + [rtp]:
root = os.path.normcase(os.path.normpath(root)) + os.sep
if name.startswith(root):
base = root.rstrip(os.sep)
name = name[len(base) + 1:]