From 5cffc4cce28701777ba212baa37dfd8c8c40edd7 Mon Sep 17 00:00:00 2001 From: Aled Cuda Date: Thu, 29 Aug 2024 23:32:26 -0700 Subject: [PATCH] Supply an empty name for compatibility with python 3.15+ and to avoid a deprecation warning on 3.13 --- pdoc/doc_ast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdoc/doc_ast.py b/pdoc/doc_ast.py index e42bb7ef..4b76413c 100644 --- a/pdoc/doc_ast.py +++ b/pdoc/doc_ast.py @@ -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 @@ -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(