Skip to content

Commit

Permalink
fix: tbset
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 8, 2024
1 parent 910b48f commit cfbde09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ape/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def __init__(
self._project = project
ex_message = f"({code}) {message}" if code else message

self.__tb: Optional[TracebackType] = None

# Finalizes expected revert message.
super().__init__(ex_message)

Expand Down Expand Up @@ -279,11 +281,15 @@ def reset_tb(self):

@property
def __traceback__(self) -> Optional[TracebackType]:
return self._calculated_traceback
if self.__tb is None:
# Calculating for the first time (though may be appended to later).
self.__tb = self._calculated_traceback

return self.__tb

@__traceback__.setter
def __traceback__(self, value):
self.__traceback__ = value
self.__tb = value


class VirtualMachineError(TransactionError):
Expand Down

0 comments on commit cfbde09

Please sign in to comment.