Commit 67ab8773 authored by Jérome Perrin's avatar Jérome Perrin

Don't keep a reference to sys.exc_info(), as described in...

Don't keep a reference to sys.exc_info(), as described in http://docs.python.org/lib/module-sys.html


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6961 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df1415c4
......@@ -183,12 +183,11 @@ class Message:
self.is_executed = 1
except:
self.is_executed = 0
exc_info = sys.exc_info()
self.exc_type = exc_info[0]
self.traceback = exc_info[2]
LOG('WARNING ActivityTool', 0,
self.exc_type = sys.exc_info()[0]
self.traceback = ''.join(traceback.format_tb(sys.exc_info()[2]))
LOG('ActivityTool', WARNING,
'Could not call method %s on object %s' % (
self.method_id, self.object_path), error=exc_info)
self.method_id, self.object_path), error=sys.exc_info())
def validate(self, activity, activity_tool):
return activity.validate(activity_tool, self, **self.activity_kw)
......@@ -213,9 +212,8 @@ Document: %s
Method: %s
Traceback:
%s
""" % (activity_tool.email_from_address, user_email,
message, message, '/'.join(self.object_path), self.method_id,
''.join(traceback.format_tb(self.traceback)))
""" % (activity_tool.email_from_address, user_email, message,
message, '/'.join(self.object_path), self.method_id, self.traceback)
activity_tool.MailHost.send( mail_text )
def reactivate(self, activity_tool):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment