[FIX] 'except Exception as variable' is invalid syntax in Python 2.5
bzr revid: xmo@openerp.com-20110520082343-y7uhx6vbf1afwfxj
This commit is contained in:
parent
d05e6b08ef
commit
3fd459098a
|
@ -565,7 +565,7 @@ class FormView(View):
|
||||||
else:
|
else:
|
||||||
res = Model.read([int(id)], [field], request.context)[0].get(field, '')
|
res = Model.read([int(id)], [field], request.context)[0].get(field, '')
|
||||||
return base64.decodestring(res)
|
return base64.decodestring(res)
|
||||||
except:
|
except: # TODO: what's the exception here?
|
||||||
return self.placeholder()
|
return self.placeholder()
|
||||||
def placeholder(self):
|
def placeholder(self):
|
||||||
return open(os.path.join(openerpweb.path_addons, 'base', 'static', 'src', 'img', 'placeholder.png'), 'rb').read()
|
return open(os.path.join(openerpweb.path_addons, 'base', 'static', 'src', 'img', 'placeholder.png'), 'rb').read()
|
||||||
|
@ -608,7 +608,7 @@ class FormView(View):
|
||||||
</script>"""
|
</script>"""
|
||||||
data = ufile.file.read()
|
data = ufile.file.read()
|
||||||
args = [size, ufile.filename, ufile.headers.getheader('Content-Type'), base64.encodestring(data)]
|
args = [size, ufile.filename, ufile.headers.getheader('Content-Type'), base64.encodestring(data)]
|
||||||
except Exception as e:
|
except Exception, e:
|
||||||
args = [False, e.message]
|
args = [False, e.message]
|
||||||
return out % (simplejson.dumps(callback), simplejson.dumps(args))
|
return out % (simplejson.dumps(callback), simplejson.dumps(args))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue