Bug 1506132 - Only __getitem__() in dicts that include the desired key to avoid printing tracebacks r=jgraham
authorWes Kocher <wkocher@mozilla.com>
Tue, 27 Nov 2018 13:22:06 +0000
changeset 504785 ffe333026cf81c22cabfbf936f6b9550103e924d
parent 504784 3d481d6d9821131f55a39efe432524906ba1ab8c
child 504786 57811a27eb990ade17f43a056e31dc146dc9785d
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1506132
milestone65.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 1506132 - Only __getitem__() in dicts that include the desired key to avoid printing tracebacks r=jgraham Differential Revision: https://phabricator.services.mozilla.com/D12998
testing/web-platform/tests/tools/wptserve/wptserve/request.py
--- a/testing/web-platform/tests/tools/wptserve/wptserve/request.py
+++ b/testing/web-platform/tests/tools/wptserve/wptserve/request.py
@@ -572,17 +572,20 @@ class MultiDict(dict):
             return default
         raise KeyError
 
     def get_list(self, key):
         """Get all values with a given key as a list
 
         :param key: The key to lookup
         """
-        return dict.__getitem__(self, key)
+        if key in self:
+            return dict.__getitem__(self, key)
+        else:
+            return []
 
     @classmethod
     def from_field_storage(cls, fs):
         self = cls()
         if fs.list is None:
             return self
         for key in fs:
             values = fs[key]