From b5fa44b2375b431ff0ec37646df12169a6d285ee Mon Sep 17 00:00:00 2001 From: Steven Casagrande Date: Wed, 6 Feb 2019 19:00:31 -0500 Subject: [PATCH] Fix socket.shutdown function call (issue #189) (#191) --- instruments/abstract_instruments/comm/socket_communicator.py | 2 +- instruments/tests/test_comm/test_socket.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instruments/abstract_instruments/comm/socket_communicator.py b/instruments/abstract_instruments/comm/socket_communicator.py index 2d68beab0..aefdd5878 100644 --- a/instruments/abstract_instruments/comm/socket_communicator.py +++ b/instruments/abstract_instruments/comm/socket_communicator.py @@ -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() diff --git a/instruments/tests/test_comm/test_socket.py b/instruments/tests/test_comm/test_socket.py index 59b943d4a..aee17e5c5 100644 --- a/instruments/tests/test_comm/test_socket.py +++ b/instruments/tests/test_comm/test_socket.py @@ -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()