/usr/lib/python3/dist-packages/livestreamer/compat.py is in python3-livestreamer 1.12.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import os
import sys
is_py2 = (sys.version_info[0] == 2)
is_py3 = (sys.version_info[0] == 3)
is_py33 = (sys.version_info[0] == 3 and sys.version_info[1] == 3)
is_win32 = os.name == "nt"
if is_py2:
_str = str
str = unicode
range = xrange
def bytes(b, enc="ascii"):
return _str(b)
elif is_py3:
bytes = bytes
str = str
range = range
try:
from urllib.parse import (
urlparse, urlunparse, urljoin, quote, unquote, parse_qsl
)
import queue
except ImportError:
from urlparse import urlparse, urlunparse, urljoin, parse_qsl
from urllib import quote, unquote
import Queue as queue
__all__ = ["is_py2", "is_py3", "is_py33", "is_win32", "str", "bytes",
"urlparse", "urlunparse", "urljoin", "parse_qsl", "quote",
"unquote", "queue", "range"]
|