Skip to content

Commit 35c7c68

Browse files
committed
Handle set literals in all versions
1 parent 19641c3 commit 35c7c68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/simpleeval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def simple_eval(node_or_string, namespace=None):
7676
7777
The string or node provided may only consist of:
7878
* the following Python literal structures: strings, numbers, tuples,
79-
lists, dicts, sets (Python 3.9+)
79+
lists, dicts, and sets
8080
* variable names causing lookups in the passed in namespace or builtins
8181
* getitem calls using the [] syntax on objects of the types above
8282
@@ -108,7 +108,7 @@ def _convert(node):
108108
(_convert(k), _convert(v))
109109
for k, v in zip(node.keys, node.values)
110110
)
111-
elif sys.version_info[:2] >= (3, 9) and isinstance(node, ast.Set):
111+
elif isinstance(node, ast.Set):
112112
return set(map(_convert, node.elts))
113113

114114
# this is a deviation from literal_eval: we allow non-literals

0 commit comments

Comments
 (0)