Skip to content

Commit

Permalink
Supply an empty name for compatibility with python 3.15+ and to avoid…
Browse files Browse the repository at this point in the history
… a deprecation warning on 3.13
  • Loading branch information
ld-cd committed Aug 30, 2024
1 parent 776b7a2 commit 5cffc4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdoc/doc_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _parse_class(source: str) -> ast.ClassDef:
t = tree.body[0]
assert isinstance(t, ast.ClassDef)
return t
return ast.ClassDef(body=[], decorator_list=[]) # type: ignore
return ast.ClassDef(name="", body=[], decorator_list=[]) # type: ignore


@cache
Expand All @@ -265,7 +265,7 @@ def _parse_function(source: str) -> ast.FunctionDef | ast.AsyncFunctionDef:
# we have a lambda function,
# to simplify the API return the ast.FunctionDef stub.
pass
return ast.FunctionDef(body=[], decorator_list=[]) # type: ignore
return ast.FunctionDef(name="", body=[], decorator_list=[]) # type: ignore


def _parse(
Expand Down

0 comments on commit 5cffc4c

Please sign in to comment.