From bbdbf6e85b39f3a9d43cda0dbba2f4021e905d71 Mon Sep 17 00:00:00 2001 From: sgrekov Date: Wed, 24 Jan 2024 16:23:02 +0200 Subject: [PATCH] return either passed traceback from exception, or traceback from exception object itself --- promise/promise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promise/promise.py b/promise/promise.py index ef9a45f..1ce7676 100644 --- a/promise/promise.py +++ b/promise/promise.py @@ -481,7 +481,7 @@ def resolve(value): def reject(reason, traceback=None): # type: (Exception, TracebackType) -> None - self._reject_callback(reason, synchronous, traceback) + self._reject_callback(reason, synchronous, traceback or getattr(reason, '__traceback__', None)) error = None traceback = None