diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8b49afe5..e68a05b4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -43,6 +43,7 @@ The following people have contributed to the development of Rich: - [Nicolas Simonds](https://github.com/0xDEC0DE) - [Aaron Stephens](https://github.com/aaronst) - [Gabriele N. Tornetta](https://github.com/p403n1x87) +- [Nils Vu](https://github.com/nilsvu) - [Arian Mollik Wasi](https://github.com/wasi-master) - [Handhika Yanuar Pratama](https://github.com/theDreamer911) - [za](https://github.com/za) diff --git a/rich/traceback.py b/rich/traceback.py index 55acaf07..5c1ac8f4 100644 --- a/rich/traceback.py +++ b/rich/traceback.py @@ -389,19 +389,17 @@ class Traceback: del stack.frames[:] cause = getattr(exc_value, "__cause__", None) - if cause and cause.__traceback__: + if cause: exc_type = cause.__class__ exc_value = cause + # __traceback__ can be None, e.g. for exceptions raised by the + # 'multiprocessing' module traceback = cause.__traceback__ is_cause = True continue cause = exc_value.__context__ - if ( - cause - and cause.__traceback__ - and not getattr(exc_value, "__suppress_context__", False) - ): + if cause and not getattr(exc_value, "__suppress_context__", False): exc_type = cause.__class__ exc_value = cause traceback = cause.__traceback__