2222import glob
2323import os
2424import sys
25- import types
2625from pathlib import Path
2726from typing import TYPE_CHECKING , cast
2827
@@ -152,16 +151,6 @@ def autodoc_process_signature(
152151 return_annotation : str ,
153152) -> tuple [str , str ]:
154153 """Modify found signatures to fix various issues."""
155- if name == "trio.testing._raises_group._ExceptionInfo.type" :
156- # This has the type "type[E]", which gets resolved into the property itself.
157- # That means Sphinx can't resolve it. Fix the issue by overwriting with a fully-qualified
158- # name.
159- assert isinstance (obj , property ), obj
160- assert isinstance (obj .fget , types .FunctionType ), obj .fget
161- assert (
162- obj .fget .__annotations__ ["return" ] == "type[MatchE]"
163- ), obj .fget .__annotations__
164- obj .fget .__annotations__ ["return" ] = "type[~trio.testing._raises_group.MatchE]"
165154 if signature is not None :
166155 signature = signature .replace ("~_contextvars.Context" , "~contextvars.Context" )
167156 if name == "trio.lowlevel.RunVar" : # Typevar is not useful here.
@@ -170,16 +159,6 @@ def autodoc_process_signature(
170159 # Strip the type from the union, make it look like = ...
171160 signature = signature .replace (" | type[trio._core._local._NoValue]" , "" )
172161 signature = signature .replace ("<class 'trio._core._local._NoValue'>" , "..." )
173- if name in ("trio.testing.RaisesGroup" , "trio.testing.Matcher" ) and (
174- "+E" in signature or "+MatchE" in signature
175- ):
176- # This typevar being covariant isn't handled correctly in some cases, strip the +
177- # and insert the fully-qualified name.
178- signature = signature .replace ("+E" , "~trio.testing._raises_group.E" )
179- signature = signature .replace (
180- "+MatchE" ,
181- "~trio.testing._raises_group.MatchE" ,
182- )
183162 if "DTLS" in name :
184163 signature = signature .replace ("SSL.Context" , "OpenSSL.SSL.Context" )
185164 # Don't specify PathLike[str] | PathLike[bytes], this is just for humans.
0 commit comments