Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 951a41ce57bd853947f842028bccb500bd5237da 1 parent 9e47143
@bertjwregeer bertjwregeer authored
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):
Please sign in to comment.
Something went wrong with that request. Please try again.