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 | 5e42591b7e51002a715c1415836b058106b625c7 (patch) | |
tree | 249ad7ae224c762eb0f75f84a9a0bc9d2d172d0a /lib | |
parent | 32e7c3146a5883ca00caeb725b2f6d5b6f229116 (diff) |
web_support: call parse_qs from urllib
The one from cgi has been removed in Python 3.8.
Diffstat (limited to 'lib')
-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): |