changeset 0f5d2a9bd5c7 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=0f5d2a9bd5c7
description:
        Do not use original_exception on werkzeug < 1.0

        InternalServerError's original_exception argument was added on version 
1.0

        issue9632
        review310551087
diffstat:

 trytond/wsgi.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r ddb9720ba255 -r 0f5d2a9bd5c7 trytond/wsgi.py
--- a/trytond/wsgi.py   Fri Oct 16 19:19:59 2020 +0200
+++ b/trytond/wsgi.py   Tue Oct 20 13:02:35 2020 +0200
@@ -143,7 +143,10 @@
                     break
             else:
                 if isinstance(data, Exception):
-                    response = InternalServerError(original_exception=data)
+                    try:
+                        response = InternalServerError(original_exception=data)
+                    except TypeError:
+                        response = InternalServerError(data)
                 else:
                     response = Response(data)
         return response

Reply via email to