Skip to content

Commit 367c2f8

Browse files
committed
Fix version check
1 parent ab6db67 commit 367c2f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/simpleeval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
import ast
3434
import inspect
35+
import sys
3536
from six import string_types
3637
from six.moves import builtins
3738

@@ -97,7 +98,7 @@ def simple_eval(node_or_string, namespace=None):
9798
node_or_string = node_or_string.body
9899

99100
def _convert(node):
100-
if py3 and isinstance(node, ast.Constant):
101+
if sys.version_info[:2] >= (3, 6) and isinstance(node, ast.Constant):
101102
return node.value
102103
if isinstance(node, _string_type_nodes):
103104
return node.s

0 commit comments

Comments
 (0)