diff options
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/src/_framework/base/packets/_ingestion.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/python/src/_framework/base/packets/_ingestion.py b/src/python/src/_framework/base/packets/_ingestion.py index abc1e7a043..91f5a35359 100644 --- a/src/python/src/_framework/base/packets/_ingestion.py +++ b/src/python/src/_framework/base/packets/_ingestion.py @@ -183,7 +183,7 @@ class _WrappedConsumer(object): payload: A customer-significant payload object. May be None only if complete is True. complete: Whether or not the end of the payload sequence has been reached. - May be False only if payload is not None. + Must be True if payload is None. Returns: True if the wrapped consumer made progress or False if the wrapped @@ -191,13 +191,12 @@ class _WrappedConsumer(object): progress. """ try: - if payload: - if complete: - self._consumer.consume_and_terminate(payload) - else: - self._consumer.consume(payload) - else: + if payload is None: self._consumer.terminate() + elif complete: + self._consumer.consume_and_terminate(payload) + else: + self._consumer.consume(payload) return True except abandonment.Abandoned: return False |