diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2021-04-30 14:16:02 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2021-04-30 14:31:02 +0200 |
commit | cb42e9bfd338e45852825961b74460cc0a56516c (patch) | |
tree | 2f76ec3d32bf92833309681453341cf35532636d | |
parent | a0861f2e90572d6c45eb05adb69e7069d9f99a58 (diff) |
web_support: call parse_qs from urllib
The one from cgi has been removed in Python 3.8.
-rw-r--r-- | lib/python/web_support.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py index 9c73ef5796..8d3573c1dc 100644 --- a/lib/python/web_support.py +++ b/lib/python/web_support.py @@ -31,6 +31,11 @@ except ImportError: from urllib.parse import quote as urllib_quote try: + from cgi import parse_qs +except ImportError: + from urllib.parse import parse_qs + +try: from SocketServer import ThreadingMixIn from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler except ImportError: @@ -838,7 +843,7 @@ class WebServiceHTTP(WebServiceBase): path = self.path[:pos] if path[:1] != '/': path = '/' + path - params = cgi.parse_qs(self.path[pos + 1:]) + params = parse_qs(self.path[pos + 1:]) return (path, params) def route(self): |