diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-11-13 11:57:45 -0800 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-11-17 16:38:01 -0800 |
commit | 8eb26b6420a358dc10af7e58d270fae690e07fdf (patch) | |
tree | 2d1b7f3e0744e80b7757182c0e978ccd20814d52 /kafka/producer/kafka.py | |
parent | 7bd6b5da6d402565f25fce9e710be26b2d4cc125 (diff) | |
download | kafka-python-use-explicit-tuples-for-strings.tar.gz |
Be explicit with tuples for %s formattinguse-explicit-tuples-for-strings
Fix #1633
Diffstat (limited to 'kafka/producer/kafka.py')
-rw-r--r-- | kafka/producer/kafka.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kafka/producer/kafka.py b/kafka/producer/kafka.py index 45bb058..685c3f9 100644 --- a/kafka/producer/kafka.py +++ b/kafka/producer/kafka.py @@ -340,11 +340,11 @@ class KafkaProducer(object): self.config[key] = configs.pop(key) # Only check for extra config keys in top-level class - assert not configs, 'Unrecognized configs: %s' % configs + assert not configs, 'Unrecognized configs: %s' % (configs,) if self.config['client_id'] is None: self.config['client_id'] = 'kafka-python-producer-%s' % \ - PRODUCER_CLIENT_ID_SEQUENCE.increment() + (PRODUCER_CLIENT_ID_SEQUENCE.increment(),) if self.config['acks'] == 'all': self.config['acks'] = -1 @@ -633,12 +633,12 @@ class KafkaProducer(object): raise Errors.MessageSizeTooLargeError( "The message is %d bytes when serialized which is larger than" " the maximum request size you have configured with the" - " max_request_size configuration" % size) + " max_request_size configuration" % (size,)) if size > self.config['buffer_memory']: raise Errors.MessageSizeTooLargeError( "The message is %d bytes when serialized which is larger than" " the total memory buffer you have configured with the" - " buffer_memory configuration." % size) + " buffer_memory configuration." % (size,)) def _wait_on_metadata(self, topic, max_wait): """ @@ -679,7 +679,7 @@ class KafkaProducer(object): elapsed = time.time() - begin if not metadata_event.is_set(): raise Errors.KafkaTimeoutError( - "Failed to update metadata after %.1f secs." % max_wait) + "Failed to update metadata after %.1f secs." % (max_wait,)) elif topic in self._metadata.unauthorized_topics: raise Errors.TopicAuthorizationFailedError(topic) else: |