We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1202d14 commit 2b08adfCopy full SHA for 2b08adf
bpython/simpleeval.py
@@ -49,14 +49,6 @@
49
_name_type_nodes = (ast.Name,)
50
51
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
60
class EvaluationError(Exception):
61
"""Raised if an exception occurred in safe_eval."""
62
@@ -277,7 +269,7 @@ def safe_get_attribute_new_style(obj, attr):
277
269
if not is_new_style(obj):
278
270
raise ValueError("%r is not a new-style class or object" % obj)
279
271
to_look_through = (obj.__mro__
280
- if isclass(obj)
272
+ if inspect.isclass(obj)
281
273
else (obj,) + type(obj).__mro__)
282
274
283
275
for cls in to_look_through:
0 commit comments