summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2023-05-16 08:56:42 -0500
committerEric Eastwood <contact@ericeastwood.com>2023-05-16 12:33:18 -0500
commit77cda342be3c81fa8557d208e67dc1662ddb462a (patch)
tree0cee727fb6f6d4ae773780805d769ced7303a000 /synapse/app
parentFix subscriptable type usage in Python <3.9 (#15604) (diff)
downloadsynapse-77cda342be3c81fa8557d208e67dc1662ddb462a.tar.xz
`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
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index 4dfcf484fa..936b1b0430 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -214,7 +214,7 @@ def handle_startup_exception(e: Exception) -> NoReturn:
     # the reactor are written to the logs, followed by a summary to stderr.
     logger.exception("Exception during startup")
 
-    error_string = "".join(traceback.format_exception(e))
+    error_string = "".join(traceback.format_exception(type(e), e, e.__traceback__))
     indented_error_string = indent(error_string, "    ")
 
     quit_with_error(