1. jayd3e
  2. WebOb - Py3

Commits

jayd3e  committed 1ebe8b9

Actually fixed the 'except' syntax this time.

  • Participants
  • Parent commits 7ea863a
  • Branches default

Comments (0)

Files changed (2)

File webob/dec.py

View file
  • Ignore whitespace
 """
 
 import six
+import sys
 import webob
 import webob.exc
 from types import ClassType
                 if self.middleware_wraps:
                     args = (self.middleware_wraps,) + args
                 resp = self.call_func(req, *args, **self.kwargs)
-            except webob.exc.HTTPException as resp:
-                pass
+            except webob.exc.HTTPException:
+                resp = sys.exc_info()[1]
             if resp is None:
                 ## FIXME: I'm not sure what this should be?
                 resp = req.response

File webob/exc.py

View file
  • Ignore whitespace
     def __call__(self, environ, start_response):
         try:
             return self.application(environ, start_response)
-        except HTTPException as exc:
+        except HTTPException:
+            exc = sys.exc_info()[1]
             parent_exc_info = sys.exc_info()
             def repl_start_response(status, headers, exc_info=None):
                 if exc_info is None: