Skip to content

Commit 2b479b4

Browse files
committed
Fix Python 3 compatibility issues
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 5b406c1 commit 2b479b4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bpython/autocomplete.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import os
2828
import rlcompleter
2929
from six.moves import range, builtins
30+
from six import string_types
3031

3132
from glob import glob
3233

@@ -312,7 +313,7 @@ def matches(self, cursor_offset, line, **kwargs):
312313
start, end, word = r
313314
if argspec:
314315
matches = set(name + '=' for name in argspec[1][0]
315-
if isinstance(name, basestring) and
316+
if isinstance(name, string_types) and
316317
name.startswith(word))
317318
if py3:
318319
matches.update(name + '=' for name in argspec[1][4]

bpython/urwid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from types import ModuleType
4444
from optparse import Option
4545
from six.moves import range
46-
from six import iteritems
46+
from six import iteritems, string_types
4747

4848
from pygments.token import Token
4949

@@ -285,7 +285,7 @@ def decoding_input_filter(keys, raw):
285285
encoding = locale.getpreferredencoding()
286286
converted_keys = list()
287287
for key in keys:
288-
if isinstance(key, basestring):
288+
if isinstance(key, string_types):
289289
converted_keys.append(key.decode(encoding))
290290
else:
291291
converted_keys.append(key)

0 commit comments

Comments
 (0)