[MERGE] report: correct exception handlers

bzr revid: odo@openerp.com-20100622105304-9bab100r6nv0x460
This commit is contained in:
P. Christeas
2010-06-22 12:53:04 +02:00
committed by Olivier Dony
2 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -380,7 +380,7 @@ class _rml_canvas(object):
try:
u = urllib.urlopen(str(node.get('file')))
s = cStringIO.StringIO(u.read())
except:
except Exception:
u = file(os.path.join(self.path,str(node.get('file'))), 'rb')
s = cStringIO.StringIO(u.read())
img = ImageReader(s)
@@ -788,7 +788,7 @@ class _rml_template(object):
try :
gr = pt.findall('pageGraphics')\
or pt[1].findall('pageGraphics')
except :
except Exception: # FIXME: be even more specific, perhaps?
gr=''
if len(gr):
drw = _rml_draw(self.localcontext,gr[0], self.doc, images=images, path=self.path, title=self.title)
@@ -818,7 +818,7 @@ def parseNode(rml, localcontext = {},fout=None, images={}, path='.',title=None):
try:
from customfonts import SetCustomFonts
SetCustomFonts(r)
except:
except Exception:
pass
fp = cStringIO.StringIO()
r.render(fp)
@@ -832,7 +832,7 @@ def parseString(rml, localcontext = {},fout=None, images={}, path='.',title=None
try:
from customfonts import SetCustomFonts
SetCustomFonts(r)
except:
except Exception:
pass
if fout:
+5 -5
View File
@@ -65,7 +65,7 @@ def _child_get(node, self=None, tagname=None):
eval(n.get('rml_except'), {}, self.localcontext)
except GeneratorExit:
continue
except:
except Exception:
logging.getLogger('report').exception()
continue
if n.get('rml_tag'):
@@ -77,7 +77,7 @@ def _child_get(node, self=None, tagname=None):
yield n2
except GeneratorExit:
yield n
except:
except Exception:
logging.getLogger('report').exception()
yield n
else:
@@ -89,7 +89,7 @@ def _child_get(node, self=None, tagname=None):
eval(n.get('rml_except'), {}, self.localcontext)
except GeneratorExit:
continue
except:
except Exception:
logging.getLogger('report').exception()
continue
if self and self.localcontext and n.get('rml_tag'):
@@ -102,7 +102,7 @@ def _child_get(node, self=None, tagname=None):
tagname = ''
except GeneratorExit:
pass
except:
except Exception:
logging.getLogger('report').exception()
pass
if (tagname is None) or (n.tag==tagname):
@@ -150,7 +150,7 @@ def unit_get(size):
decimal_point = '.'
try:
decimal_point = locale.nl_langinfo(locale.RADIXCHAR)
except:
except Exception:
decimal_point = locale.localeconv()['decimal_point']
size = size.replace(decimal_point, '.')