fix socketutils shutdown test error on OS X (fixing #71)

This commit is contained in:
Mahmoud Hashemi 2016-05-23 02:01:20 -07:00
parent 5fc66ab6cb
commit cdd53d2011
1 changed files with 7 additions and 1 deletions

View File

@ -142,7 +142,13 @@ def test_client_disconnecting():
if sys.platform != 'win32': # Windows socketpairs are kind of bad
assert False, 'expected socket.error broken pipe'
by.shutdown(socket.SHUT_RDWR)
try:
by.shutdown(socket.SHUT_RDWR)
except socket.error:
# Mac sockets are already shut down at this point. See #71.
if sys.platform != 'darwin':
raise
by.close()
assert not by.getsendbuffer()