@@ -4558,10 +4558,8 @@ def bad_node(self, node):
45584558 c_default = "NULL"
45594559 elif (isinstance (expr , ast .BinOp ) or
45604560 (isinstance (expr , ast .UnaryOp ) and
4561- not (isinstance (expr .operand , ast .Num ) or
4562- (hasattr (ast , 'Constant' ) and
4563- isinstance (expr .operand , ast .Constant ) and
4564- type (expr .operand .value ) in (int , float , complex )))
4561+ not (isinstance (expr .operand , ast .Constant ) and
4562+ type (expr .operand .value ) in {int , float , complex })
45654563 )):
45664564 c_default = kwargs .get ("c_default" )
45674565 if not (isinstance (c_default , str ) and c_default ):
@@ -4658,14 +4656,10 @@ def bad_node(self, node):
46584656 self .function .parameters [key ] = p
46594657
46604658 def parse_converter (self , annotation ):
4661- if (hasattr (ast , 'Constant' ) and
4662- isinstance (annotation , ast .Constant ) and
4659+ if (isinstance (annotation , ast .Constant ) and
46634660 type (annotation .value ) is str ):
46644661 return annotation .value , True , {}
46654662
4666- if isinstance (annotation , ast .Str ):
4667- return annotation .s , True , {}
4668-
46694663 if isinstance (annotation , ast .Name ):
46704664 return annotation .id , False , {}
46714665
0 commit comments