Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r48913:9827978a2b97 Date: 2011-10-17 11:01 +0200 http://bitbucket.org/pypy/pypy/changeset/9827978a2b97/
Log: fix test_urllib2_localnet - don't be too eager on closing the response, closing it when we have a socket error seems to be enough to avoid the leak (and yet you pass tests). diff --git a/lib-python/modified-2.7/urllib2.py b/lib-python/modified-2.7/urllib2.py --- a/lib-python/modified-2.7/urllib2.py +++ b/lib-python/modified-2.7/urllib2.py @@ -395,11 +395,7 @@ meth_name = protocol+"_response" for processor in self.process_response.get(protocol, []): meth = getattr(processor, meth_name) - try: - response = meth(req, response) - except: - response.close() - raise + response = meth(req, response) return response _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit