Commit d1c862ff authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-30199: test_ssl closes all asyncore channels (#1381) (#1408)

AsyncoreEchoServer of test_ssl now calls
asyncore.close_all(ignore_all=True) to ensure that
asyncore.socket_map is cleared once the test completes, even if
ConnectionHandler was not correctly unregistered.

Fix the following warning:

Warning -- asyncore.socket_map was modified by test_ssl
  Before: {}
  After:  {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}
(cherry picked from commit 1dae7450)
parent df569254
...@@ -1955,6 +1955,8 @@ else: ...@@ -1955,6 +1955,8 @@ else:
self.join() self.join()
if support.verbose: if support.verbose:
sys.stdout.write(" cleanup: successfully joined.\n") sys.stdout.write(" cleanup: successfully joined.\n")
# make sure that ConnectionHandler is removed from socket_map
asyncore.close_all(ignore_all=True)
def start(self, flag=None): def start(self, flag=None):
self.flag = flag self.flag = flag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment