code: def _show_traceback(method):
      
      def m(self, *args, **kwargs):
          try:
              return(method(self, *args, **kwargs))
          except Exception as e:
              ip = get_ipython()
              if ip is None:
                  self.log.warning("Exception in widget method %s: %s", method, e, exc_info=True)
              else:
                  ip.showtraceback()
      return m
docs: decorator for showing tracebacks in IPython