Bug 1615898 [wpt PR 21822] - Iterating over dictionary's items with six library for PY2 & PY3 comp…, a=testonly
authorZiran Sun <zsun@igalia.com>
Mon, 17 Feb 2020 17:03:37 +0000
changeset 514510 06705ec6ae73173f1eede4bc59f5311cad6a9a89
parent 514509 5fd7a1490e6224276edc49552f4124d73d87a74a
child 514511 3d93a80c7e0bc643b7c0c43305b38792297cd2c4
push id107608
push userwptsync@mozilla.com
push dateTue, 18 Feb 2020 19:32:13 +0000
treeherderautoland@292082ca1880 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1615898, 21822
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1615898 [wpt PR 21822] - Iterating over dictionary's items with six library for PY2 & PY3 comp…, a=testonly Automatic update from web-platform-tests Iterating over dictionary's items with six library for PY2 & PY3 compatibility. -- wpt-commits: ef72cc2212e324334032148aea9169edf2562ef5 wpt-pr: 21822
testing/web-platform/tests/tools/webdriver/webdriver/protocol.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/protocol.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/protocol.py
@@ -1,12 +1,14 @@
 import json
 
 import webdriver
 
+from six import iteritems
+
 
 """WebDriver wire protocol codecs."""
 
 
 class Encoder(json.JSONEncoder):
     def __init__(self, *args, **kwargs):
         kwargs.pop("session")
         super(Encoder, self).__init__(*args, **kwargs)
@@ -34,10 +36,10 @@ class Decoder(json.JSONDecoder):
             return [self.object_hook(x) for x in payload]
         elif isinstance(payload, dict) and webdriver.Element.identifier in payload:
             return webdriver.Element.from_json(payload, self.session)
         elif isinstance(payload, dict) and webdriver.Frame.identifier in payload:
             return webdriver.Frame.from_json(payload, self.session)
         elif isinstance(payload, dict) and webdriver.Window.identifier in payload:
             return webdriver.Window.from_json(payload, self.session)
         elif isinstance(payload, dict):
-            return {k: self.object_hook(v) for k, v in payload.iteritems()}
+            return {k: self.object_hook(v) for k, v in iteritems(payload)}
         return payload