Skip to content

Commit 2b08adf

Browse files
committed
Remove Python 2.6 workaround
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 1202d14 commit 2b08adf

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

bpython/simpleeval.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@
4949
_name_type_nodes = (ast.Name,)
5050

5151

52-
# inspect.isclass is broken in Python 2.6
53-
if sys.version_info[:2] == (2, 6):
54-
def isclass(obj):
55-
return isinstance(obj, (type, types.ClassType))
56-
else:
57-
isclass = inspect.isclass
58-
59-
6052
class EvaluationError(Exception):
6153
"""Raised if an exception occurred in safe_eval."""
6254

@@ -277,7 +269,7 @@ def safe_get_attribute_new_style(obj, attr):
277269
if not is_new_style(obj):
278270
raise ValueError("%r is not a new-style class or object" % obj)
279271
to_look_through = (obj.__mro__
280-
if isclass(obj)
272+
if inspect.isclass(obj)
281273
else (obj,) + type(obj).__mro__)
282274

283275
for cls in to_look_through:

0 commit comments

Comments
 (0)