Handle PEP479 issues on ha
Similar to how PEP479 was handled on config[1]. Instances of "raise StopIteration" were changed to a plain 'return' statement in order to avoid breaking the existing logic. CentOS 7 tests: PASS: Build & install PASS: Successful Bootstrap Debian Bullseye tests: PASS: Build & install PASS: Successful Bootstrap [1] https://review.opendev.org/c/starlingx/config/+/825447 Story: 2009101 Task: 44513 Signed-off-by: Matheus Machado Guilhermino <Matheus.MachadoGuilhermino@windriver.com> Change-Id: Ibe4717e64fcee159c1bc4a17acf623adbfae3908
This commit is contained in:
parent
e7ed35ae4a
commit
6ffad90d16
@ -500,7 +500,7 @@ class MulticallProxyWaiter(object):
|
|||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
"""Return a result until we get a reply with an 'ending" flag"""
|
"""Return a result until we get a reply with an 'ending" flag"""
|
||||||
if self._done:
|
if self._done:
|
||||||
raise StopIteration
|
return
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
data = self._dataqueue.get(timeout=self._timeout)
|
data = self._dataqueue.get(timeout=self._timeout)
|
||||||
@ -513,7 +513,7 @@ class MulticallProxyWaiter(object):
|
|||||||
self.done()
|
self.done()
|
||||||
if self._got_ending:
|
if self._got_ending:
|
||||||
self.done()
|
self.done()
|
||||||
raise StopIteration
|
return
|
||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
self.done()
|
self.done()
|
||||||
raise result
|
raise result
|
||||||
@ -556,7 +556,7 @@ class MulticallWaiter(object):
|
|||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
"""Return a result until we get a 'None' response from consumer"""
|
"""Return a result until we get a 'None' response from consumer"""
|
||||||
if self._done:
|
if self._done:
|
||||||
raise StopIteration
|
return
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
next(self._iterator)
|
next(self._iterator)
|
||||||
@ -565,7 +565,7 @@ class MulticallWaiter(object):
|
|||||||
self.done()
|
self.done()
|
||||||
if self._got_ending:
|
if self._got_ending:
|
||||||
self.done()
|
self.done()
|
||||||
raise StopIteration
|
return
|
||||||
result = self._result
|
result = self._result
|
||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
self.done()
|
self.done()
|
||||||
|
@ -665,7 +665,7 @@ class Connection(object):
|
|||||||
|
|
||||||
for iteration in itertools.count(0):
|
for iteration in itertools.count(0):
|
||||||
if limit and iteration >= limit:
|
if limit and iteration >= limit:
|
||||||
raise StopIteration
|
return
|
||||||
yield self.ensure(_error_callback, _consume)
|
yield self.ensure(_error_callback, _consume)
|
||||||
|
|
||||||
def cancel_consumer_thread(self):
|
def cancel_consumer_thread(self):
|
||||||
|
@ -440,7 +440,7 @@ class Connection(object):
|
|||||||
|
|
||||||
for iteration in itertools.count(0):
|
for iteration in itertools.count(0):
|
||||||
if limit and iteration >= limit:
|
if limit and iteration >= limit:
|
||||||
raise StopIteration
|
return
|
||||||
yield self.ensure(_error_callback, _consume)
|
yield self.ensure(_error_callback, _consume)
|
||||||
|
|
||||||
def cancel_consumer_thread(self):
|
def cancel_consumer_thread(self):
|
||||||
|
@ -294,7 +294,7 @@ class ResponseBodyIterator(object):
|
|||||||
if chunk:
|
if chunk:
|
||||||
return chunk
|
return chunk
|
||||||
else:
|
else:
|
||||||
raise StopIteration()
|
return
|
||||||
|
|
||||||
# In Python 3, __next__() has replaced next().
|
# In Python 3, __next__() has replaced next().
|
||||||
__next__ = next
|
__next__ = next
|
||||||
|
Loading…
Reference in New Issue
Block a user