Skip to content

Commit 9069419

Browse files
committed
we surely don't need to support python 2.7 now :)
1 parent 77c578a commit 9069419

1 file changed

Lines changed: 2 additions & 30 deletions

File tree

Lib/_pyrepl/fancycompleter.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,6 @@
1515
import os.path
1616
from itertools import count
1717

18-
PY3K = sys.version_info[0] >= 3
19-
20-
# python3 compatibility
21-
# ---------------------
22-
try:
23-
from itertools import izip
24-
except ImportError:
25-
izip = zip
26-
27-
try:
28-
from types import ClassType
29-
except ImportError:
30-
ClassType = type
31-
32-
try:
33-
unicode
34-
except NameError:
35-
unicode = str
36-
37-
# ----------------------
38-
3918
class Color:
4019
black = '30'
4120
darkred = '31'
@@ -78,13 +57,12 @@ class DefaultConfig:
7857
types.FunctionType: Color.blue,
7958
types.BuiltinFunctionType: Color.blue,
8059

81-
ClassType: Color.fuchsia,
8260
type: Color.fuchsia,
8361

8462
types.ModuleType: Color.teal,
8563
type(None): Color.lightgray,
8664
str: Color.green,
87-
unicode: Color.green,
65+
bytes: Color.green,
8866
int: Color.yellow,
8967
float: Color.yellow,
9068
complex: Color.yellow,
@@ -257,12 +235,6 @@ def attr_matches(self, text):
257235
except Exception:
258236
val = None # Include even if attribute not set
259237

260-
if not PY3K and isinstance(word, unicode):
261-
# this is needed because pyrepl doesn't like unicode
262-
# completions: as soon as it finds something which is not str,
263-
# it stops.
264-
word = word.encode('utf-8')
265-
266238
names.append(word)
267239
values.append(val)
268240
if names or not noprefix:
@@ -292,7 +264,7 @@ def attr_matches(self, text):
292264
def color_matches(self, names, values):
293265
matches = [self.color_for_obj(i, name, obj)
294266
for i, name, obj
295-
in izip(count(), names, values)]
267+
in zip(count(), names, values)]
296268
# We add a space at the end to prevent the automatic completion of the
297269
# common prefix, which is the ANSI ESCAPE sequence.
298270
return matches + [' ']

0 commit comments

Comments
 (0)