Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 77cda34

Browse files
committed
traceback.format_exception(...) usage that is compatible with Python 3.7 and 3.11 (#15599)
* Usage that is compatible with Python 3.8 and 3.11 > Since Python 3.10, instead of passing value and tb, an exception object can be passed as the first argument. If value and tb are provided, the first argument is ignored in order to provide backwards compatibility. > > -- https://docs.python.org/3/library/traceback.html * Add changelog
1 parent c51d2e6 commit 77cda34

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/15599.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Print full error and stack-trace of any exception that occurs during startup/initialization.

synapse/app/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def handle_startup_exception(e: Exception) -> NoReturn:
214214
# the reactor are written to the logs, followed by a summary to stderr.
215215
logger.exception("Exception during startup")
216216

217-
error_string = "".join(traceback.format_exception(e))
217+
error_string = "".join(traceback.format_exception(type(e), e, e.__traceback__))
218218
indented_error_string = indent(error_string, " ")
219219

220220
quit_with_error(

0 commit comments

Comments
 (0)