diff options
Diffstat (limited to 'kafka')
-rw-r--r-- | kafka/producer/simple.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kafka/producer/simple.py b/kafka/producer/simple.py index 17e0977..2699cf2 100644 --- a/kafka/producer/simple.py +++ b/kafka/producer/simple.py @@ -70,10 +70,12 @@ class SimpleProducer(Producer): def send_messages(self, topic, *msg): if not isinstance(topic, six.binary_type): - raise TypeError("topic must be type bytes") + topic = topic.encode('utf-8') partition = self._next_partition(topic) - return super(SimpleProducer, self).send_messages(topic, partition, *msg) + return super(SimpleProducer, self).send_messages( + topic, partition, *msg + ) def __repr__(self): return '<SimpleProducer batch=%s>' % self.async |