mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
web_config: fix python2/3 unification for parse_qs
This commit is contained in:
parent
028d9e8e3b
commit
5c16b5598b
1 changed files with 3 additions and 5 deletions
|
@ -11,10 +11,8 @@ IS_PY2 = sys.version_info[0] == 2
|
|||
if IS_PY2:
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
try:
|
||||
from urllib.parse import parse_qs
|
||||
except ImportError:
|
||||
from cgi import parse_qs
|
||||
from urlparse import parse_qs
|
||||
|
||||
else:
|
||||
import http.server as SimpleHTTPServer
|
||||
import socketserver as SocketServer
|
||||
|
@ -788,7 +786,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|||
elif ctype == 'application/x-www-form-urlencoded':
|
||||
length = int(self.headers['content-length'])
|
||||
url_str = self.rfile.read(length).decode('utf-8')
|
||||
postvars = cgi.parse_qs(url_str, keep_blank_values=1)
|
||||
postvars = parse_qs(url_str, keep_blank_values=1)
|
||||
elif ctype == 'application/json':
|
||||
length = int(self.headers['content-length'])
|
||||
url_str = self.rfile.read(length).decode('utf-8')
|
||||
|
|
Loading…
Reference in a new issue