Explicit format string argument indices for python 2.6 compatibility
This commit is contained in:
@@ -147,7 +147,7 @@ class KafkaClient(object):
|
||||
|
||||
if self.config['api_version'] is not None:
|
||||
assert self.config['api_version'] in self.API_VERSIONS, (
|
||||
'api_version [{}] must be one of: {}'.format(
|
||||
'api_version [{0}] must be one of: {1}'.format(
|
||||
self.config['api_version'], str(self.API_VERSIONS)))
|
||||
|
||||
self.cluster = ClusterMetadata(**self.config)
|
||||
|
@@ -400,7 +400,7 @@ class Fetcher(six.Iterator):
|
||||
inner_timestamp = msg.timestamp
|
||||
|
||||
else:
|
||||
raise ValueError('Unknown timestamp type: {}'.format(msg.timestamp_type))
|
||||
raise ValueError('Unknown timestamp type: {0}'.format(msg.timestamp_type))
|
||||
else:
|
||||
inner_timestamp = msg.timestamp
|
||||
|
||||
|
@@ -10,7 +10,7 @@ class KafkaError(RuntimeError):
|
||||
def __str__(self):
|
||||
if not self.args:
|
||||
return self.__class__.__name__
|
||||
return '{}: {}'.format(self.__class__.__name__,
|
||||
return '{0}: {1}'.format(self.__class__.__name__,
|
||||
super(KafkaError, self).__str__())
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class BrokerResponseError(KafkaError):
|
||||
|
||||
def __str__(self):
|
||||
"""Add errno to standard KafkaError str"""
|
||||
return '[Error {}] {}: {}'.format(
|
||||
return '[Error {0}] {1}: {2}'.format(
|
||||
self.errno,
|
||||
self.__class__.__name__,
|
||||
super(KafkaError, self).__str__()) # pylint: disable=bad-super-call
|
||||
|
Reference in New Issue
Block a user