Skip to content

Commit bcbc0c4

Browse files
committed
Explicit format string argument indices for python 2.6 compatibility
1 parent 87648d7 commit bcbc0c4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

kafka/client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __init__(self, **configs):
147147

148148
if self.config['api_version'] is not None:
149149
assert self.config['api_version'] in self.API_VERSIONS, (
150-
'api_version [{}] must be one of: {}'.format(
150+
'api_version [{0}] must be one of: {1}'.format(
151151
self.config['api_version'], str(self.API_VERSIONS)))
152152

153153
self.cluster = ClusterMetadata(**self.config)

kafka/consumer/fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def _unpack_message_set(self, tp, messages):
400400
inner_timestamp = msg.timestamp
401401

402402
else:
403-
raise ValueError('Unknown timestamp type: {}'.format(msg.timestamp_type))
403+
raise ValueError('Unknown timestamp type: {0}'.format(msg.timestamp_type))
404404
else:
405405
inner_timestamp = msg.timestamp
406406

kafka/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class KafkaError(RuntimeError):
1010
def __str__(self):
1111
if not self.args:
1212
return self.__class__.__name__
13-
return '{}: {}'.format(self.__class__.__name__,
13+
return '{0}: {1}'.format(self.__class__.__name__,
1414
super(KafkaError, self).__str__())
1515

1616

@@ -63,7 +63,7 @@ class BrokerResponseError(KafkaError):
6363

6464
def __str__(self):
6565
"""Add errno to standard KafkaError str"""
66-
return '[Error {}] {}: {}'.format(
66+
return '[Error {0}] {1}: {2}'.format(
6767
self.errno,
6868
self.__class__.__name__,
6969
super(KafkaError, self).__str__()) # pylint: disable=bad-super-call

0 commit comments

Comments
 (0)