summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2016-05-22 17:16:20 -0700
committerDana Powers <dana.powers@gmail.com>2016-05-22 17:16:20 -0700
commit42293725e5361fd6e6fd38b0ac58afda82e94d3a (patch)
tree9c1276799f53a928335a4e70b96fa563787a790c
parent77cb35078a7408ebb0eab4bfc2220cc11c10d3b2 (diff)
downloadkafka-python-42293725e5361fd6e6fd38b0ac58afda82e94d3a.tar.gz
Dont use soon-to-be-reserved keyword await as function name (FutureProduceResult) (#697)
-rw-r--r--kafka/producer/future.py4
-rw-r--r--kafka/producer/record_accumulator.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/kafka/producer/future.py b/kafka/producer/future.py
index acf4255..27cf33b 100644
--- a/kafka/producer/future.py
+++ b/kafka/producer/future.py
@@ -23,7 +23,7 @@ class FutureProduceResult(Future):
self._latch.set()
return ret
- def await(self, timeout=None):
+ def wait(self, timeout=None):
# wait() on python2.6 returns None instead of the flag value
return self._latch.wait(timeout) or self._latch.is_set()
@@ -46,7 +46,7 @@ class FutureRecordMetadata(Future):
self.relative_offset))
def get(self, timeout=None):
- if not self.is_done and not self._produce_future.await(timeout):
+ if not self.is_done and not self._produce_future.wait(timeout):
raise Errors.KafkaTimeoutError(
"Timeout after waiting for %s secs." % timeout)
assert self.is_done
diff --git a/kafka/producer/record_accumulator.py b/kafka/producer/record_accumulator.py
index 4434b18..90cb386 100644
--- a/kafka/producer/record_accumulator.py
+++ b/kafka/producer/record_accumulator.py
@@ -470,7 +470,7 @@ class RecordAccumulator(object):
for batch in self._incomplete.all():
log.debug('Waiting on produce to %s',
batch.produce_future.topic_partition)
- assert batch.produce_future.await(timeout=timeout), 'Timeout waiting for future'
+ assert batch.produce_future.wait(timeout=timeout), 'Timeout waiting for future'
assert batch.produce_future.is_done, 'Future not done?'
if batch.produce_future.failed():
log.warning(batch.produce_future.exception)