mirror of https://github.com/celery/kombu.git
str.encode does not accept kwargs in Py < 2.7. Closes #68. Thanks to mbudde
This commit is contained in:
parent
b4b5d18f91
commit
419d08bee6
|
@ -25,6 +25,7 @@ from boto.sqs.message import Message
|
|||
|
||||
from kombu.transport import virtual
|
||||
from kombu.utils import cached_property, uuid
|
||||
from kombu.utils.encoding import safe_str
|
||||
|
||||
|
||||
# dots are replaced by dash, all other punctuation
|
||||
|
@ -153,7 +154,7 @@ class Channel(virtual.Channel):
|
|||
|
||||
def entity_name(self, name, table=CHARS_REPLACE_TABLE):
|
||||
"""Format AMQP queue name into a legal SQS queue name."""
|
||||
return name.encode(errors="replace").translate(table)
|
||||
return safe_str(name).translate(table)
|
||||
|
||||
def _new_queue(self, queue, **kwargs):
|
||||
"""Ensures a queue exists in SQS."""
|
||||
|
|
Loading…
Reference in New Issue