diff options
author | Brian May <brian@linuxpenguins.xyz> | 2018-08-20 17:02:59 +1000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2018-08-20 17:03:53 +1000 |
commit | 85592e7c4627fd355fee2a7d322360f51d7c08c0 (patch) | |
tree | ca3ce3f8db23d27966c756f9f8544cb0b92a696a /lib/python/web_support.py | |
parent | b92c7cf1a42bd1588e7788a63bae735b65b27513 (diff) |
Replace "x.has_key(y)" with "y in x" syntax
Diffstat (limited to 'lib/python/web_support.py')
-rw-r--r-- | lib/python/web_support.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py index dc54c5b07a..c320ff033c 100644 --- a/lib/python/web_support.py +++ b/lib/python/web_support.py @@ -547,7 +547,7 @@ class PathRouter: for x in range(len(p)): element = p[x] if element: - if m.has_key(element): + if element in m: m = m[element] else: if element == '*': @@ -587,18 +587,18 @@ class PathRouter: try: m = m[element] except KeyError: - if x + 1 == l and m.has_key('*'): + if x + 1 == l and '*' in m: # Use '*' only if the remaining path is empty. return (m['*'], tuple(p[x:])) - if m.has_key('**'): + if '**' in m: return (m['**'], tuple(p[x:])) raise InvalidPath() try: result = m[''] except KeyError: - if m.has_key('*'): + if '*' in m: result = m['*'] - elif m.has_key('**'): + elif '**' in m: result = m['**'] else: raise InvalidPath() |