Skip to content

Commit

Permalink
Revert "馃敡 Stop using the cgi stdlib module"
Browse files Browse the repository at this point in the history
This reverts commit 6b7c2cd.
  • Loading branch information
webknjaz committed Jan 9, 2023
1 parent 6b7c2cd commit 7338b83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
v(next)
-------

* Removed the use of :mod:`cgi` deprecated in Python 3.11
-- by :user:`webknjaz`.

v18.8.0
-------

Expand Down
9 changes: 2 additions & 7 deletions cherrypy/lib/httputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import re
import builtins
from binascii import b2a_base64
from cgi import parse_header
from email.header import decode_header
from email.message import EmailMessage as _EmailMessage
from http.server import BaseHTTPRequestHandler
from urllib.parse import unquote_plus

Expand Down Expand Up @@ -155,12 +155,7 @@ def __unicode__(self):
@staticmethod
def parse(elementstr):
"""Transform 'token;key=val' to ('token', {'key': 'val'})."""
msg = _EmailMessage()
msg['content-type'] = elementstr

initial_value = msg.get_content_type()
params = dict(msg['content-type'].params)

initial_value, params = parse_header(elementstr)
return initial_value, params

@classmethod
Expand Down

0 comments on commit 7338b83

Please sign in to comment.