From a9bd4f2ce18f5c1c5c861ebbcf214d0166d1ef36 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 17 Jun 2011 18:56:45 +0200 Subject: [PATCH] [FIX] netsv: don't try to post_mortem exception which don't have tracebacks (for --debug) bzr revid: odo@openerp.com-20110617165645-zno4dj303irhndhx --- openerp/netsvc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/netsvc.py b/openerp/netsvc.py index 1316c044dc7..42ccab414c7 100644 --- a/openerp/netsvc.py +++ b/openerp/netsvc.py @@ -37,6 +37,7 @@ import sys import threading import time import warnings +import types from pprint import pformat # TODO modules that import netsvc only for things from loglevels must be changed to use loglevels. @@ -440,7 +441,7 @@ class OpenERPDispatcher: self.log('exception', tools.exception_to_unicode(e)) tb = getattr(e, 'traceback', sys.exc_info()) tb_s = cgitb.text(tb) - if tools.config['debug_mode']: + if tools.config['debug_mode'] and isinstance(tb, types.TracebackType): import pdb pdb.post_mortem(tb[2]) raise OpenERPDispatcherException(e, tb_s)