From 8427e09424bb6491d2c570baafde27c112e4852f Mon Sep 17 00:00:00 2001 From: Andrew Mitchell <32021055+mitch292@users.noreply.github.com> Date: Thu, 1 Oct 2020 21:48:09 -0400 Subject: [PATCH] ast.get_docstring: fix return type (#4595) Resolves #4575 --- stdlib/3/ast.pyi | 2 +- third_party/3/typed_ast/ast3.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/ast.pyi b/stdlib/3/ast.pyi index 6192dde00..8011424cf 100644 --- a/stdlib/3/ast.pyi +++ b/stdlib/3/ast.pyi @@ -191,7 +191,7 @@ else: def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... def fix_missing_locations(node: _T) -> _T: ... -def get_docstring(node: AST, clean: bool = ...) -> str: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ... def increment_lineno(node: _T, n: int = ...) -> _T: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... diff --git a/third_party/3/typed_ast/ast3.pyi b/third_party/3/typed_ast/ast3.pyi index 631924cfb..3dac9b2e1 100644 --- a/third_party/3/typed_ast/ast3.pyi +++ b/third_party/3/typed_ast/ast3.pyi @@ -12,7 +12,7 @@ def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: st def copy_location(new_node: AST, old_node: AST) -> AST: ... def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... def fix_missing_locations(node: AST) -> AST: ... -def get_docstring(node: AST, clean: bool = ...) -> str: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ... def increment_lineno(node: AST, n: int = ...) -> AST: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...