Made it compatible to python3.7
Due to https://www.python.org/dev/peps/pep-0479/ stopIteration will not be caught anymore and needs to be use return instead. updated with relevant changes. Change-Id: If25b6ccecd46fed0225a230096041996fb91c0c5 closes-bug: #1837778
This commit is contained in:
parent
ef042bf4e7
commit
5815d94781
@ -542,7 +542,7 @@ class BlobIterator(object):
|
||||
bytes_left -= len(data)
|
||||
i += 1
|
||||
yield data
|
||||
raise StopIteration()
|
||||
return
|
||||
|
||||
|
||||
def validate_status_transition(af, from_status, to_status):
|
||||
|
@ -227,7 +227,7 @@ class TestReaders(base.BaseTestCase):
|
||||
yield chunk
|
||||
iteration += 1
|
||||
if iteration >= max_iterations:
|
||||
raise StopIteration()
|
||||
return
|
||||
|
||||
def _test_reader_chunked(self, chunk_size, read_size, max_iterations=5):
|
||||
generator = self._create_generator(chunk_size, max_iterations)
|
||||
|
6
tox.ini
6
tox.ini
@ -8,7 +8,7 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
PYTHONDONTWRITEBYTECODE = 1
|
||||
LANGUAGE=en_US
|
||||
usedevelop = True
|
||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
/bin/rm -f .testrepository/times.dbm
|
||||
@ -24,8 +24,8 @@ commands = oslo_debug_helper {posargs}
|
||||
basepython = python2.7
|
||||
commands = oslo_debug_helper {posargs}
|
||||
|
||||
[testenv:debug-py35]
|
||||
basepython = python3.5
|
||||
[testenv:debug-py37]
|
||||
basepython = python3.7
|
||||
commands = oslo_debug_helper {posargs}
|
||||
|
||||
[testenv:pep8]
|
||||
|
Loading…
Reference in New Issue
Block a user