jupyter / nbclient

A client library for executing notebooks. Formally nbconvert's ExecutePreprocessor
https://nbclient.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
152 stars 55 forks source link

avoid duplicate 'Exception: message' in CellExecutionError #283

Closed minrk closed 1 year ago

minrk commented 1 year ago

tracebacks end with this info, so no need to repeat it in our template unless the traceback is empty. Currently exceptions end with:

...
----> 5 raise Exception("message")

Exception: message
Exception: message

where the first Exception: message occurs in the traceback, while the second is added by the message template. This PR removes the second, instead switching on an empty template in CellExecutionError.__str__.

Removes unused __unicode__ method for Python 2 unicode reprs.