Unconditionally define the bytes version of unquote_plus
@@ -115,9 +115,14 @@ except ImportError:
import re
import sys
import tempfile
-try:
- from urllib import unquote_plus
-except ImportError:
+
+import cheroot.server
+
+import cherrypy
+from cherrypy._cpcompat import ntou, unquote
+from cherrypy.lib import httputil
+
+
def unquote_plus(bs):
"""Bytes version of urllib.parse.unquote_plus."""
bs = bs.replace(b'+', b' ')
@@ -131,12 +136,6 @@ except ImportError:
pass
return b''.join(atoms)
-import cheroot.server
-
-import cherrypy
-from cherrypy._cpcompat import ntou, unquote
-from cherrypy.lib import httputil
-
# ------------------------------- Processors -------------------------------- #
