file_open raise a nice exception when a file is not found

bzr revid: bch-e5b4023e441eb8f655efe16976c94e8580a88284
This commit is contained in:
bch 2007-05-03 13:34:39 +00:00
parent 7f7d33e194
commit 0095f89aef
2 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,7 @@
"module/module_wizard.xml",
"module/module_view.xml",
"module/module_report.xml",
"module/move_module_wizard.xml",
# "module/move_module_wizard.xml",
"res/res_request_view.xml",
"res/partner/partner_report.xml",
"res/partner/partner_view.xml",

View File

@ -183,7 +183,8 @@ def file_open(name, mode="r", subdir='addons'):
import StringIO
zfile = zipfile.ZipFile(head)
return StringIO.StringIO(zfile.read(os.path.join(os.path.basename(head), name)))
return None
raise IOError, 'File not found : '+str(name)
#----------------------------------------------------------
# Emails