From 0a8dabdf22e14396d3edcfeab4791065840bcc8c Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Sat, 17 Dec 2016 10:39:06 -0800 Subject: Use connection state functions where possible --- kafka/conn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'kafka/conn.py') diff --git a/kafka/conn.py b/kafka/conn.py index 50dc4d9..ba88ca6 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -523,6 +523,7 @@ class BrokerConnection(object): return self._send(request, expect_response=expect_response) def _send(self, request, expect_response=True): + assert self.state in (ConnectionStates.AUTHENTICATING, ConnectionStates.CONNECTED) future = Future() correlation_id = self._next_correlation_id() header = RequestHeader(request, -- cgit v1.2.1