Skip to content

Commit

Permalink
Fix socket.shutdown function call (issue #189) (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
scasagrande committed Feb 7, 2019
1 parent bb4ab21 commit b5fa44b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def close(self):
Shutdown and close the `socket.socket` connection.
"""
try:
self._conn.shutdown()
self._conn.shutdown(socket.SHUT_RDWR)
finally:
self._conn.close()

Expand Down
2 changes: 1 addition & 1 deletion instruments/tests/test_comm/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_socketcomm_close():
comm._conn = mock.MagicMock()

comm.close()
comm._conn.shutdown.assert_called_with()
comm._conn.shutdown.assert_called_with(socket.SHUT_RDWR)
comm._conn.close.assert_called_with()


Expand Down

0 comments on commit b5fa44b

Please sign in to comment.