[FIX] in load_information_from_description_file, f can be a StringIO (in case of zipped module) and StringIO are not contextmanagers.

So rollback the context management thingie

bzr revid: xmo@openerp.com-20120202154532-tq9x07ujf0bn9mcp
This commit is contained in:
Xavier Morel 2012-02-02 16:45:32 +01:00
parent aea1b13412
commit df8af0ec4a
1 changed files with 5 additions and 3 deletions

View File

@ -332,7 +332,6 @@ def load_information_from_description_file(module):
'description': '',
'icon': get_module_icon(module),
'installable': True,
'auto_install': False,
'license': 'AGPL-3',
'name': False,
'post_load': None,
@ -345,8 +344,11 @@ def load_information_from_description_file(module):
'depends data demo test init_xml update_xml demo_xml'.split(),
iter(list, None)))
with tools.file_open(terp_file) as terp_f:
info.update(eval(terp_f.read()))
f = tools.file_open(terp_file)
try:
info.update(eval(f.read()))
finally:
f.close()
if 'active' in info:
# 'active' has been renamed 'auto_install'