From 09b440ae0f379e5123f66c73899ed8a8495dbffd 2012-08-14 20:46:09 From: MinRK Date: 2012-08-14 20:46:09 Subject: [PATCH] RemoteError._render_traceback_ calls self.render_traceback rather than an alias There are two options here: 1. `_render_traceback_` should *call* render_traceback 2. any subclass that redefines render_traceback must also redefine `_render_traceback_` I went with 1., which is more efficient code-wise when subclassing RemoteError (would prevent future cases of this same mistake), but less efficient execution-wise, because it involves an extra function call. closes #2303 --- diff --git a/IPython/parallel/error.py b/IPython/parallel/error.py index c797f7c..67d5187 100644 --- a/IPython/parallel/error.py +++ b/IPython/parallel/error.py @@ -195,8 +195,9 @@ class RemoteError(KernelError): return (self.traceback or "No traceback available").splitlines() # Special method for custom tracebacks within IPython - _render_traceback_ = render_traceback - + def _render_traceback_(self): + return self.render_traceback() + def print_traceback(self, excid=None): """print my traceback""" print('\n'.join(self.render_traceback()))