src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsFunctionVisitor.py

branch
eric7
changeset 10169
0f70a4ef4592
parent 10119
64147a7e6393
child 10170
6cf1ee737d8f
equal deleted inserted replaced
10168:8312e0e76795 10169:0f70a4ef4592
569 @param node reference to the AST Return node 569 @param node reference to the AST Return node
570 @type ast.Return 570 @type ast.Return
571 """ 571 """
572 if node.value is not None: 572 if node.value is not None:
573 # In the event of an explicit `None` return (`return None`), the 573 # In the event of an explicit `None` return (`return None`), the
574 # node body will be an instance of either `ast.Constant` (3.8+) or 574 # node body will be an instance `ast.Constant` (3.8+), which we
575 # `ast.NameConstant`, which we need to check to see if it's 575 # need to check to see if it's actually `None`
576 # actually `None`
577 if ( 576 if (
578 isinstance(node.value, (ast.Constant, ast.NameConstant)) 577 isinstance(node.value, ast.Constant)
579 and node.value.value is None 578 and node.value.value is None
580 ): 579 ):
581 return 580 return
582 581
583 self.__nonNoneReturnNodes.add(self.__context[-1]) 582 self.__nonNoneReturnNodes.add(self.__context[-1])

eric ide

mercurial