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 ab6db67 commit 367c2f8Copy full SHA for 367c2f8
bpython/simpleeval.py
@@ -32,6 +32,7 @@
32
33
import ast
34
import inspect
35
+import sys
36
from six import string_types
37
from six.moves import builtins
38
@@ -97,7 +98,7 @@ def simple_eval(node_or_string, namespace=None):
97
98
node_or_string = node_or_string.body
99
100
def _convert(node):
- if py3 and isinstance(node, ast.Constant):
101
+ if sys.version_info[:2] >= (3, 6) and isinstance(node, ast.Constant):
102
return node.value
103
if isinstance(node, _string_type_nodes):
104
return node.s
0 commit comments