Reduce fatal exception to a warning for 'eval'
If the data xml contains an eval expression that does not compute, the convert procedure would throw an exception all the way up. Now, catch that and only display a warning. Hopefully, this warning will be fixed to contain more useful info about its nature. bzr revid: p_christ@hol.gr-20080926072827-41i7lihw2i9uaisk
This commit is contained in:
parent
c9bef54c28
commit
7d9e3b7c16
|
@ -106,7 +106,12 @@ def _eval_xml(self,node, pool, cr, uid, idref, context=None):
|
|||
all_timezones=[]
|
||||
pytz=pytzclass()
|
||||
idref['pytz'] = pytz
|
||||
try:
|
||||
return eval(a_eval, idref)
|
||||
except:
|
||||
logger = netsvc.Logger()
|
||||
logger.notifyChannel("init", netsvc.LOG_WARNING, 'could eval(%s) for %s in %s, please get back and fix it!' % (a_eval,node.getAttribute('name'),context))
|
||||
return ""
|
||||
if t == 'xml':
|
||||
def _process(s, idref):
|
||||
m = re.findall('[^%]%\((.*?)\)[ds]', s)
|
||||
|
|
Loading…
Reference in New Issue