From 6fbff7034767c94282287251eead777e417008d8 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Sat, 26 Apr 2025 11:38:18 +0200 Subject: [PATCH] format_exception in capture_or_log_exception: drop python 3.9 compat reverts (the meat of) c51051dc2e55 --- sentry_sdk_extensions/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sentry_sdk_extensions/__init__.py b/sentry_sdk_extensions/__init__.py index ff95347..c87b3cd 100644 --- a/sentry_sdk_extensions/__init__.py +++ b/sentry_sdk_extensions/__init__.py @@ -122,11 +122,7 @@ def capture_or_log_exception(e, logger): # this gnarly approach makes it so that the logger prefixes (e.g. snappea task number, dates etc) are shown # for each of the lines of the traceback (though it has the disadvantage of time not standing still while # we iterate in the loop). - # - # the 3-argument signature is needed for Python 3.9 (in Python 3.10 and up .format_exception(e) is enough). - # https://docs.python.org/3.10/library/traceback.html#traceback.print_exception - # > If value and tb are provided, the first argument is ignored in order to provide backwards compatibility. - for bunch_of_lines in traceback.format_exception(type(e), e, e.__traceback__): + for bunch_of_lines in traceback.format_exception(e): for line in bunch_of_lines.splitlines(): # Note: when .is_initialized() is True, .error is spammy (it gets captured) but we don't have that # problem in this branch.