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]) |