diff --git a/test/unit/common/middleware/test_swift3.py b/test/unit/common/middleware/test_swift3.py index 29daf8335e..4e82366648 100644 --- a/test/unit/common/middleware/test_swift3.py +++ b/test/unit/common/middleware/test_swift3.py @@ -134,8 +134,8 @@ class FakeAppObject(FakeApp): if 'HTTP_RANGE' in env: resp = Response(body=self.object_body, conditional_response=True) - iter = resp(env, start_response) - return iter.pop() + resp_iter = iter(resp(env, start_response)) + return resp_iter.next() start_response(Response().status, self.response_headers.items()) if env['REQUEST_METHOD'] == 'GET':