Browse Source

[core] Make cherrypy server compatible with py2 and py3 exception wise

Romain 5 years ago
parent
commit
bc86386436
1 changed files with 2 additions and 4 deletions
  1. 2 4
      desktop/core/src/desktop/lib/wsgiserver.py

+ 2 - 4
desktop/core/src/desktop/lib/wsgiserver.py

@@ -101,6 +101,7 @@ number of requests and their responses, so we run a nested loop:
 
 
 from future import standard_library
+from future.utils import raise_
 standard_library.install_aliases()
 from builtins import hex
 from builtins import range
@@ -654,10 +655,7 @@ class HTTPRequest(object):
         # exc_info tuple."
         if self.sent_headers:
             try:
-                if sys.version_info[0] > 2:
-                    raise (exc_info[0], exc_info[1], exc_info[2])
-                else:
-                    raise exc_info[0], exc_info[1], exc_info[2]
+                raise_(exc_info[0], exc_info[1], exc_info[2])
             finally:
                 exc_info = None