socket.close() was modified in Python 3.6 to raise OSError on failure: see bpo-26685. (cherry picked from commit 67e1478dba)
67e1478dba