summaryrefslogtreecommitdiff
path: root/src/waitress/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/waitress/compat.py')
-rw-r--r--src/waitress/compat.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/waitress/compat.py b/src/waitress/compat.py
index 7c2630c..67543b9 100644
--- a/src/waitress/compat.py
+++ b/src/waitress/compat.py
@@ -1,50 +1,14 @@
-import _thread as thread
-from http import client as httplib
-from io import StringIO as NativeIO
-import os
import platform
# Fix for issue reported in https://github.com/Pylons/waitress/issues/138,
# Python on Windows may not define IPPROTO_IPV6 in socket.
import socket
import sys
-from urllib import parse as urlparse
-from urllib.parse import unquote_to_bytes
import warnings
# True if we are running on Windows
WIN = platform.system() == "Windows"
-string_types = (str,)
-integer_types = (int,)
-class_types = (type,)
-text_type = str
-binary_type = bytes
-long = int
-
-
-def unquote_bytes_to_wsgi(bytestring):
- return unquote_to_bytes(bytestring).decode("latin-1")
-
-
-def text_(s, encoding="latin-1", errors="strict"):
- """ If ``s`` is an instance of ``binary_type``, return
- ``s.decode(encoding, errors)``, otherwise return ``s``"""
-
- if isinstance(s, binary_type):
- return s.decode(encoding, errors)
-
- return s # pragma: no cover
-
-
-def tostr(s):
- return str(s, "latin-1", "strict")
-
-
-def tobytes(s):
- return bytes(s, "latin-1")
-
-
MAXINT = sys.maxsize
HAS_IPV6 = socket.has_ipv6