8181 is_function_or_cython_function )
8282
8383_getdoc = getdoc
84+
85+
8486def getdoc (obj , * args , ** kwargs ):
8587 return sage_getdoc_original (obj )
88+
89+
8690# ------------------------------------------------------------------
8791
8892if TYPE_CHECKING :
@@ -1616,7 +1620,7 @@ def can_document_member(
16161620 try :
16171621 result_bool = isinstance (member , type ) or (
16181622 isattr and isinstance (member , NewType | TypeVar ))
1619- except :
1623+ except Exception :
16201624 result_bool = isinstance (member , type ) or (
16211625 isattr and (inspect .isNewType (member ) or isinstance (member , TypeVar )))
16221626 return result_bool
@@ -1695,7 +1699,7 @@ def import_object(self, raiseerror: bool = False) -> bool:
16951699 # support both sphinx 8 and py3.9/older sphinx
16961700 try :
16971701 test_bool = isinstance (self .object , NewType | TypeVar )
1698- except :
1702+ except Exception :
16991703 test_bool = inspect .isNewType (self .object ) or isinstance (self .object , TypeVar )
17001704 if test_bool :
17011705 modname = getattr (self .object , '__module__' , self .modname )
@@ -1709,7 +1713,7 @@ def _get_signature(self) -> tuple[Any | None, str | None, Signature | None]:
17091713 # support both sphinx 8 and py3.9/older sphinx
17101714 try :
17111715 test_bool = isinstance (self .object , NewType | TypeVar )
1712- except :
1716+ except Exception :
17131717 test_bool = inspect .isNewType (self .object ) or isinstance (self .object , TypeVar )
17141718 if test_bool :
17151719 # Suppress signature
@@ -1899,7 +1903,7 @@ def add_directive_header(self, sig: str) -> None:
18991903 # support both sphinx 8 and py3.9/older sphinx
19001904 try :
19011905 test_bool = isinstance (self .object , NewType | TypeVar )
1902- except :
1906+ except Exception :
19031907 test_bool = inspect .isNewType (self .object ) or isinstance (self .object , TypeVar )
19041908 if test_bool :
19051909 return
@@ -1911,7 +1915,7 @@ def add_directive_header(self, sig: str) -> None:
19111915 # support both sphinx 8 and py3.9/older sphinx
19121916 try :
19131917 newtype_test = isinstance (self .object , NewType )
1914- except :
1918+ except Exception :
19151919 newtype_test = inspect .isNewType (self .object )
19161920 if (not self .doc_as_attr and not newtype_test
19171921 and canonical_fullname and self .fullname != canonical_fullname ):
@@ -2053,7 +2057,7 @@ def add_content(self, more_content: StringList | None) -> None:
20532057 # support both sphinx 8 and py3.9/older sphinx
20542058 try :
20552059 newtype_test = isinstance (self .object , NewType )
2056- except :
2060+ except Exception :
20572061 newtype_test = inspect .isNewType (self .object )
20582062 if newtype_test :
20592063 if self .config .autodoc_typehints_format == "short" :
0 commit comments