Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only try and close a socket if it's set, update the integration test

  • Loading branch information...
commit d62d7a9b9576575c482cd81f5ee9a8c0933ffa98 1 parent c1c6263
Gavin M. Roy authored
3  pika/adapters/base_connection.py
View
@@ -129,7 +129,8 @@ def _adapter_connect(self):
def _adapter_disconnect(self):
"""Invoked if the connection is being told to disconnect"""
#self.socket.shutdown(socket.SHUT_RDWR)
- self.socket.close()
+ if self.socket:
+ self.socket.close()
self.socket = None
self._check_state_on_disconnect()
self._handle_ioloop_stop()
3  pika/adapters/blocking_connection.py
View
@@ -152,7 +152,8 @@ def close(self, reply_code=200, reply_text='Normal shutdown'):
def disconnect(self):
"""Disconnect from the socket"""
self._set_connection_state(self.CONNECTION_CLOSED)
- self.socket.close()
+ if self.socket:
+ self.socket.close()
def process_data_events(self):
"""Will make sure that data events are processed. Your app can
6 tests/integration/broker.conf
View
@@ -1,5 +1,5 @@
-username: admin
-password: secret
+username: guest
+password: guest
host: localhost
port: 5672
-virtual_host: testing
+virtual_host: /
2  tests/integration/test_base.py
View
@@ -90,7 +90,7 @@ def stop(self):
self.connection.add_on_close_callback(self._on_closed)
self.connection.close()
- def _on_closed(self, frame):
+ def _on_closed(self, connection, reply_code, reply_text):
'''called when the connection has finished closing'''
self.connection.ioloop.stop()
if self._timed_out:
Please sign in to comment.
Something went wrong with that request. Please try again.