Skip to content
Browse files

Check for None explicitly instead of truthiness

If we check for truthines the object itself may return False, which
would mean self.close is not set to app_iter.close, which means that we
may end up leaking.
  • Loading branch information...
1 parent 9e47143 commit 951a41ce57bd853947f842028bccb500bd5237da @bertjwregeer bertjwregeer committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 webob/response.py
View
2 webob/response.py
@@ -1218,7 +1218,7 @@ class EmptyResponse(object):
"""
def __init__(self, app_iter=None):
- if app_iter and hasattr(app_iter, 'close'):
+ if app_iter is not None and hasattr(app_iter, 'close'):
self.close = app_iter.close
def __iter__(self):

0 comments on commit 951a41c

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