[FIX] 'except Exception as variable' is invalid syntax in Python 2.5

bzr revid: xmo@openerp.com-20110520082343-y7uhx6vbf1afwfxj
This commit is contained in:
Xavier Morel 2011-05-20 10:23:43 +02:00
parent d05e6b08ef
commit 3fd459098a
1 changed files with 2 additions and 2 deletions

View File

@ -565,7 +565,7 @@ class FormView(View):
else:
res = Model.read([int(id)], [field], request.context)[0].get(field, '')
return base64.decodestring(res)
except:
except: # TODO: what's the exception here?
return self.placeholder()
def placeholder(self):
return open(os.path.join(openerpweb.path_addons, 'base', 'static', 'src', 'img', 'placeholder.png'), 'rb').read()
@ -608,7 +608,7 @@ class FormView(View):
</script>"""
data = ufile.file.read()
args = [size, ufile.filename, ufile.headers.getheader('Content-Type'), base64.encodestring(data)]
except Exception as e:
except Exception, e:
args = [False, e.message]
return out % (simplejson.dumps(callback), simplejson.dumps(args))