From 3bf91eab25c602a6fad2665456f57e8629c5a6f4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 11 Aug 2015 13:51:14 +0200 Subject: Use Python3-compatible dict method names Python 2 has keys()/values()/items(), which return lists, iterkeys()/itervalues()/iteritems(), which return iterators, and viewkeys()/viewvalues()/viewitems() which return views. Python 3 has only keys()/values()/items(), which return views. To get iterators, one can use iter() or a for loop/comprehension; for lists there's the list() constructor. When iterating through the entire dict, without modifying the dict, the difference between Python 2's items() and iteritems() is negligible, especially on small dicts (the main overhead is extra memory, not CPU time). In the interest of simpler code, this patch changes many instances of iteritems() to items(), iterkeys() to keys() etc. In other cases, helpers like six.itervalues are used. Reviewed-By: Christian Heimes Reviewed-By: Jan Cholasta --- ipatests/test_webui/ui_driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipatests/test_webui') diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index 16af5ff16..d097a5490 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -154,7 +154,7 @@ class UI_driver(object): c = self.config # override with environmental variables - for k, v in ENV_MAP.iteritems(): + for k, v in ENV_MAP.items(): val = os.environ.get(k) if val is not None: c[v] = val -- cgit