Skip to content

Commit c829a83

Browse files
committed
Remove use of six.string_types
1 parent 68ffad8 commit c829a83

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

bpython/autocomplete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import re
3232
import rlcompleter
3333
from six.moves import builtins
34-
from six import string_types, iteritems
34+
from six import iteritems
3535

3636
from . import inspection
3737
from . import importcompletion
@@ -460,7 +460,7 @@ def matches(self, cursor_offset, line, **kwargs):
460460
matches = set(
461461
name + "="
462462
for name in argspec[1][0]
463-
if isinstance(name, string_types) and name.startswith(r.word)
463+
if isinstance(name, str) and name.startswith(r.word)
464464
)
465465
matches.update(
466466
name + "="

bpython/simpleeval.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import ast
3131
import inspect
3232
import sys
33-
from six import string_types
3433
from six.moves import builtins
3534

3635
from . import line as line_properties
@@ -82,7 +81,7 @@ def simple_eval(node_or_string, namespace=None):
8281
"""
8382
if namespace is None:
8483
namespace = {}
85-
if isinstance(node_or_string, string_types):
84+
if isinstance(node_or_string, str):
8685
node_or_string = ast.parse(node_or_string, mode="eval")
8786
if isinstance(node_or_string, ast.Expression):
8887
node_or_string = node_or_string.body
@@ -179,7 +178,7 @@ def _convert(node):
179178

180179
def safe_getitem(obj, index):
181180
""" Safely tries to access obj[index] """
182-
if type(obj) in (list, tuple, dict, bytes) + string_types:
181+
if type(obj) in (list, tuple, dict, bytes, str):
183182
try:
184183
return obj[index]
185184
except (KeyError, IndexError):

bpython/urwid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import locale
4040
import signal
4141
from optparse import Option
42-
from six import iteritems, string_types
42+
from six import iteritems
4343

4444
from pygments.token import Token
4545

@@ -278,7 +278,7 @@ def decoding_input_filter(keys, raw):
278278
encoding = locale.getpreferredencoding()
279279
converted_keys = list()
280280
for key in keys:
281-
if isinstance(key, string_types):
281+
if isinstance(key, str):
282282
converted_keys.append(key.decode(encoding))
283283
else:
284284
converted_keys.append(key)

0 commit comments

Comments
 (0)