Skip to content

Commit 943f1ec

Browse files
committed
chore: Remove more _compat
1 parent 4cd5ca8 commit 943f1ec

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

libtmux/_compat.py

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,10 @@
11
# -*- coding: utf8 -*-
22
# flake8: NOQA
3-
import configparser
4-
import pickle
53
import sys
6-
import urllib.parse as urlparse
74
from collections.abc import MutableMapping
8-
from io import BytesIO, StringIO
9-
from string import ascii_lowercase
10-
from urllib.request import urlretrieve
11-
12-
PY2 = sys.version_info[0] == 2
13-
14-
_identity = lambda x: x
15-
16-
17-
unichr = chr
18-
text_type = str
19-
string_types = (str,)
20-
integer_types = (int,)
21-
22-
text_to_native = lambda s, enc: s
23-
24-
iterkeys = lambda d: iter(d.keys())
25-
itervalues = lambda d: iter(d.values())
26-
iteritems = lambda d: iter(d.items())
27-
28-
29-
izip = zip
30-
imap = map
31-
range_type = range
32-
33-
cmp = lambda a, b: (a > b) - (a < b)
345

356
console_encoding = sys.__stdout__.encoding
367

37-
implements_to_string = _identity
38-
398

409
def console_to_str(s):
4110
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
@@ -51,11 +20,8 @@ def reraise(tp, value, tb=None):
5120
raise value
5221

5322

54-
number_types = integer_types + (float,)
55-
56-
5723
def str_from_console(s):
5824
try:
59-
return text_type(s)
25+
return str(s)
6026
except UnicodeDecodeError:
61-
return text_type(s, encoding='utf_8')
27+
return str(s, encoding='utf_8')

0 commit comments

Comments
 (0)