diff --git a/bin/netsvc.py b/bin/netsvc.py index 91630563452..e0e97efe28d 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -364,10 +364,7 @@ class OpenERPDispatcher: self.log('service', service_name) self.log('method', method) self.log('params', params) - if hasattr(self,'auth_provider'): - auth = self.auth_provider - else: - auth = None + auth = getattr(self, 'auth_provider', None) result = ExportService.getService(service_name).dispatch(method, auth, params) self.log('result', result) # We shouldn't marshall None, @@ -376,10 +373,7 @@ class OpenERPDispatcher: return result except Exception, e: self.log('exception', tools.exception_to_unicode(e)) - if hasattr(e, 'traceback'): - tb = e.traceback - else: - tb = sys.exc_info() + tb = getattr(e, 'traceback', sys.exc_info()) tb_s = "".join(traceback.format_exception(*tb)) if tools.config['debug_mode']: import pdb