Tidy up exception traceback in TCP Comms
@@ -118,9 +118,11 @@ def convert_stream_closed_error(obj, exc):
raise FatalCommClosedError(
"in %s: %s: %s" % (obj, exc.__class__.__name__, exc)
)
- raise CommClosedError("in %s: %s: %s" % (obj, exc.__class__.__name__, exc))
+ raise CommClosedError(
+ "in %s: %s: %s" % (obj, exc.__class__.__name__, exc)
+ ) from exc
else:
- raise CommClosedError("in %s: %s" % (obj, exc))
+ raise CommClosedError("in %s: %s" % (obj, exc)) from exc
def _do_nothing():
