Skip to content

Commit e4a5f66

Browse files
committed
Remove pre 2.6 code
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 66449af commit e4a5f66

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

bpython/autocomplete.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from __future__ import with_statement
2525
import __builtin__
2626
import __main__
27+
import abc
2728
import rlcompleter
2829
import line as lineparts
2930
import re
@@ -33,16 +34,6 @@
3334
from bpython import importcompletion
3435
from bpython._py3compat import py3
3536

36-
# Needed for special handling of __abstractmethods__
37-
# abc only exists since 2.6, so check both that it exists and that it's
38-
# the one we're expecting
39-
try:
40-
import abc
41-
abc.ABCMeta
42-
has_abc = True
43-
except (ImportError, AttributeError):
44-
has_abc = False
45-
4637
# Autocomplete modes
4738
SIMPLE = 'simple'
4839
SUBSTRING = 'substring'
@@ -338,7 +329,7 @@ def attr_lookup(obj, expr, attr, autocomplete_mode):
338329
if hasattr(obj, '__class__'):
339330
words.append('__class__')
340331
words = words + rlcompleter.get_class_members(obj.__class__)
341-
if has_abc and not isinstance(obj.__class__, abc.ABCMeta):
332+
if not isinstance(obj.__class__, abc.ABCMeta):
342333
try:
343334
words.remove('__abstractmethods__')
344335
except ValueError:

0 commit comments

Comments
 (0)