Skip to content

Commit

Permalink
fix: Ensure to support python v3.10 (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
selcukcihan authored Apr 20, 2023
1 parent c36d982 commit 062f26e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions python/packages/sdk/sls_sdk/lib/stack_trace_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
def resolve(error: Optional[Any] = None) -> str:
if isinstance(error, BaseException):
# in case of an actual Exception, stack trace is already set up.
return "".join(
traceback.format_exception(
etype=type(error), value=error, tb=error.__traceback__
)
)
return "".join(traceback.format_exception(error, error, error.__traceback__))
else:
# in case of errors that are not exceptions, return the current stack trace
# but exclude the most recent 3 frames to make sure stack trace ends at
Expand Down
4 changes: 1 addition & 3 deletions python/packages/sdk/tests/lib/test_stack_trace_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def func():

# then
assert stack_trace == "".join(
traceback.format_exception(
etype=type(error), value=error, tb=error.__traceback__
)
traceback.format_exception(error, error, error.__traceback__)
)


Expand Down

0 comments on commit 062f26e

Please sign in to comment.