From 46d62bd9be201986555919c60d5b836b13dda105 Mon Sep 17 00:00:00 2001 From: Victor Stinner <victor.stinner@enovance.com> Date: Mon, 24 Mar 2014 18:19:17 +0100 Subject: [PATCH] Python 3: Replace iter.next() with six.next(iter) Use six.next() to be Python 3 compatible. Change-Id: Ia16148a759d368872787d5896a7b1dc42ffcdfb5 --- tests/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index dcaca9e3..914bc8fa 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -92,7 +92,7 @@ def fake_http_connect(*code_iter, **kwargs): if not self.timestamp: del headers['x-timestamp'] try: - if container_ts_iter.next() is False: + if next(container_ts_iter) is False: headers['x-container-timestamp'] = '1' except StopIteration: pass @@ -141,9 +141,9 @@ def fake_http_connect(*code_iter, **kwargs): kwargs['give_content_type']('') if 'give_connect' in kwargs: kwargs['give_connect'](*args, **ckwargs) - status = code_iter.next() - etag = etag_iter.next() - timestamp = timestamps_iter.next() + status = next(code_iter) + etag = next(etag_iter) + timestamp = next(timestamps_iter) if status <= 0: raise RequestException() fake_conn = FakeConn(status, etag, body=kwargs.get('body', ''),