[pypy-commit] pypy py3.5: Use try-finally in ConnectionHandler to ensure resource cleanup and prevent timeout

rlamy pypy.commits at gmail.com
Thu Nov 10 10:00:12 EST 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r88292:9d22a6f232ff
Date: 2016-11-10 14:59 +0000
http://bitbucket.org/pypy/pypy/changeset/9d22a6f232ff/

Log:	Use try-finally in ConnectionHandler to ensure resource cleanup and
	prevent timeout

diff --git a/lib-python/3/test/test_ssl.py b/lib-python/3/test/test_ssl.py
--- a/lib-python/3/test/test_ssl.py
+++ b/lib-python/3/test/test_ssl.py
@@ -1838,7 +1838,14 @@
                 else:
                     self.sock.close()
 
+            # PyPy change
             def run(self):
+                try:
+                    self._run()
+                finally:
+                    self.close()
+
+            def _run(self):
                 self.running = True
                 if not self.server.starttls_server:
                     if not self.wrap_conn():


More information about the pypy-commit mailing list