[Tarantool-patches] [PATCH v3 4/5] test: get rid of iteritems()

sergeyb at tarantool.org sergeyb at tarantool.org
Wed Dec 23 15:36:10 MSK 2020


From: Sergey Bronnikov <estetus at gmail.com>

For Python 3, PEP 3106 changed the design of the dict builtin and the
mapping API in general to replace the separate list based and iterator
based APIs in Python 2 with a merged, memory efficient set and multiset
view based API. This new style of dict iteration was also added to the
Python 2.7 dict type as a new set of iteration methods. PEP-0469 [1]
recommends to replace d.iteritems() to iter(d.items()) to make code
compatible with Python 3.

1. https://www.python.org/dev/peps/pep-0469/

Part of #5538
---
 test/app-tap/httpd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py
index b57ef1e39..a2dee1b83 100755
--- a/test/app-tap/httpd.py
+++ b/test/app-tap/httpd.py
@@ -66,7 +66,7 @@ def read_handle(env, response):
     body = ["Not Found"]
     if env["PATH_INFO"] in paths:
         code, body, headers = paths[env["PATH_INFO"]]()
-    for key,value in env.iteritems():
+    for key,value in iter(env.items()):
         if "HTTP_" in key:
             headers.append((key[5:].lower(), value))
     response(code, headers)
-- 
2.25.1



More information about the Tarantool-patches mailing list