AMQP_PROTOCOL_HEADER must be bytes on py3k

This commit is contained in:
Ask Solem 2011-09-16 18:12:47 +01:00
parent f6bb91931f
commit d0c7b9a2d0
1 changed files with 2 additions and 1 deletions

View File

@ -23,13 +23,14 @@ from amqplib.client_0_8.exceptions import AMQPConnectionException
from amqplib.client_0_8.exceptions import AMQPChannelException
from kombu.transport import base
from kombu.utils.encoding import str_to_bytes
DEFAULT_PORT = 5672
# amqplib's handshake mistakenly identifies as protocol version 1191,
# this breaks in RabbitMQ tip, which no longer falls back to
# 0-8 for unknown ids.
transport.AMQP_PROTOCOL_HEADER = "AMQP\x01\x01\x08\x00"
transport.AMQP_PROTOCOL_HEADER = str_to_bytes("AMQP\x01\x01\x08\x00")
class Connection(amqp.Connection): # pragma: no cover