Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Dec 15, 2021
1 parent 756a79d commit c37d055
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/sage_docbuild/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ class RemoteException(Exception):
tb: str

def __init__(self, tb: str):
"""
Initialize the exception.
INPUT:
- ``tb`` -- the traceback of the exception.
"""
self.tb = tb

def __str__(self):
"""
Return a string representation of the exception.
"""
return self.tb


Expand All @@ -30,6 +40,15 @@ class RemoteExceptionWrapper:
tb: str

def __init__(self, exc: BaseException):
"""
Initialize the exception wrapper.
INPUT:
- ``exc`` -- the exception to wrap.
"""
self.exc = exc
self.tb = traceback.format_exc()
# We cannot pickle the traceback, thus convert it to a string.
# Later on unpickling, we set the original tracback as the cause of the exception
# This approach is taken from https://bugs.python.org/issue13831
Expand Down

0 comments on commit c37d055

Please sign in to comment.