Skip to content

Commit 73b7c47

Browse files
committed
fix
1 parent 1e1e8da commit 73b7c47

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mypy/stubgenc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,9 @@ def generate_function_stub(
579579
if not isinstance(docstring, str):
580580
docstring = None
581581

582+
if docstring:
583+
docstring = self._indent_docstring(docstring)
584+
582585
ctx = FunctionContext(
583586
self.module_name,
584587
name,
@@ -612,11 +615,7 @@ def generate_function_stub(
612615
if inferred[0].args and inferred[0].args[0].name == "cls":
613616
decorators.append("@classmethod")
614617

615-
output.extend(
616-
self.format_func_def(
617-
inferred, decorators=decorators, docstring=self._indent_docstring(docstring)
618-
)
619-
)
618+
output.extend(self.format_func_def(inferred, decorators=decorators, docstring=docstring))
620619
self._fix_iter(ctx, inferred, output)
621620

622621
def _indent_docstring(self, docstring: str) -> str:

0 commit comments

Comments
 (0)