From c25475879c1f2af06899bcef8f9c32ced93bc192 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 13:02:07 +0100 Subject: [PATCH] [IMP] opening and getting data from module description file bzr revid: xmo@openerp.com-20111209120207-3kkyvwedbjez29rl --- openerp/modules/module.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 4b9771636c7..899fa6efece 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -254,16 +254,9 @@ def load_information_from_description_file(module): 'depends data demo test init_xml update_xml demo_xml'.split(), iter(list, None))) - terp_f = tools.file_open(terp_file) - try: + with tools.file_open(terp_file) as terp_f: info.update(eval(terp_f.read())) - except Exception: - logger.notifyChannel('modules', netsvc.LOG_ERROR, - 'module %s: exception while evaluating file %s' % - (module, terp_file)) - raise - finally: - terp_f.close() + return info #TODO: refactor the logger in this file to follow the logging guidelines