def on_connect(self, connection):
    self._sock = connection._sock
    kwargs = {'protocolError': InvalidResponse, 'replyError': self.parse_error}
    if (not HIREDIS_SUPPORTS_CALLABLE_ERRORS):
        kwargs['replyError'] = ResponseError
    if connection.decode_responses:
        kwargs['encoding'] = connection.encoding
    self._reader = hiredis.Reader(**kwargs)
    self._next_response = False
def on_connect(self, connection):
    self._sock = connection._sock
    kwargs = {'protocolError': InvalidResponse, 'replyError': self.parse_error}
    if (not HIREDIS_SUPPORTS_CALLABLE_ERRORS):
        kwargs['replyError'] = ResponseError
    if connection.decode_responses:
        kwargs['encoding'] = connection.encoding
    self._reader = hiredis.Reader(**kwargs)
    self._next_response = False