Skip to content

Commit 8dd1ec4

Browse files
committed
simple_eval: handle ast.Constant
This removes a deviation from Python's implementation.
1 parent 471fa82 commit 8dd1ec4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bpython/simpleeval.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def simple_eval(node_or_string, namespace=None):
9797
node_or_string = node_or_string.body
9898

9999
def _convert(node):
100+
if py3 and isinstance(node, ast.Constant):
101+
return node.value
100102
if isinstance(node, _string_type_nodes):
101103
return node.s
102104
elif isinstance(node, ast.Num):

0 commit comments

Comments
 (0)