Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Nov 16, 2023
1 parent 1e1e8da commit 73b7c47
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ def generate_function_stub(
if not isinstance(docstring, str):
docstring = None

if docstring:
docstring = self._indent_docstring(docstring)

ctx = FunctionContext(
self.module_name,
name,
Expand Down Expand Up @@ -612,11 +615,7 @@ def generate_function_stub(
if inferred[0].args and inferred[0].args[0].name == "cls":
decorators.append("@classmethod")

output.extend(
self.format_func_def(
inferred, decorators=decorators, docstring=self._indent_docstring(docstring)
)
)
output.extend(self.format_func_def(inferred, decorators=decorators, docstring=docstring))
self._fix_iter(ctx, inferred, output)

def _indent_docstring(self, docstring: str) -> str:
Expand Down

0 comments on commit 73b7c47

Please sign in to comment.