aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-17 13:40:37 +0100
committerGravatar jesopo2019-09-17 13:40:37 +0100
commitfa95eaa9eb596ede203780485a70950c1df15d7b (patch)
treea50bbbada49fe658d8779edd1cbf611d9e136f4a /src
parentuse Queue.get() with timeout, not Process.join() for timeout (diff)
signature
add .get() to CaseInsensitiveDict
Diffstat (limited to 'src')
-rw-r--r--src/utils/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index ce20bdff..8f4920f4 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -251,6 +251,8 @@ class CaseInsensitiveDict(dict):
return dict.__setitem__(self, key.lower(), value)
def __contains__(self, key: str):
return dict.__contains__(self, key.lower())
+ def get(self, key: str, default: typing.Any=None):
+ return dict.get(self, key.lower(), default)
def is_ip(s: str) -> bool:
try: