Explicit format string argument indices for python 2.6 compatibility

This commit is contained in:
Dana Powers
2016-07-17 10:44:32 -07:00
parent 87648d74f4
commit bcbc0c4e9a
3 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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