File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ def _convert(node):
111111 elif isinstance (node , ast .Set ):
112112 return set (map (_convert , node .elts ))
113113 elif (
114- isinstance (node , Call )
115- and isinstance (node .func , Name )
114+ isinstance (node , ast . Call )
115+ and isinstance (node .func , ast . Name )
116116 and node .func .id == "set"
117117 and node .args == node .keywords == []
118118 ):
Original file line number Diff line number Diff line change 22
33import ast
44import numbers
5+ import sys
56
67from bpython .simpleeval import (
78 simple_eval ,
@@ -25,6 +26,10 @@ def test_matches_stdlib(self):
2526 def test_matches_stdlib_py3 (self ):
2627 """Should match the stdlib literal_eval if no names or indexing"""
2728 self .assertMatchesStdlib ("{1, 2}" )
29+
30+ @unittest .skipUnless (sys .version_info [:2 ] >= (3 , 9 ), "Only Python3.9 evaluates set()" )
31+ def test_matches_stdlib_set_literal (self ):
32+ """set() is evaluated"""
2833 self .assertMatchesStdlib ("set()" )
2934
3035 def test_indexing (self ):
You can’t perform that action at this time.
0 commit comments