Skip to content
Browse files

Better connection check in RequestHandler

  • Loading branch information...
1 parent e101397 commit b6ea32d35d3a2b6692aa855e9679aefab4ecc2d5 @ahassany ahassany committed May 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 tornado/web.py
View
2 tornado/web.py
@@ -123,7 +123,7 @@ def __init__(self, application, request, **kwargs):
self.ui["modules"] = self.ui["_modules"]
self.clear()
# Check since connection is not available in WSGI
- if hasattr(self.request, "connection"):
+ if getattr(self.request, "connection", None):
self.request.connection.stream.set_close_callback(
self.on_connection_close)
self.initialize(**kwargs)

0 comments on commit b6ea32d

Please sign in to comment.
Something went wrong with that request. Please try again.