File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ Bugs fixed
96
96
file URL (user-defined base URL of an intersphinx project are left untouched
97
97
even if they end with double forward slashes).
98
98
Patch by Bénédikt Tran.
99
+ * #12797: Fix
100
+ `TypeError: Some type variables (...) are not listed in Generic[...] `
101
+ when inheriting from both Generic and autodoc mocked class.
99
102
100
103
Testing
101
104
-------
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class _MockObject:
29
29
__name__ = ''
30
30
__sphinx_mock__ = True
31
31
__sphinx_decorator_args__ : tuple [Any , ...] = ()
32
+ __sphinx_empty_attrs__ : ('__typing_subst__' ,)
32
33
33
34
def __new__ (cls , * args : Any , ** kwargs : Any ) -> Any :
34
35
if len (args ) == 3 and isinstance (args [1 ], tuple ):
@@ -59,6 +60,8 @@ def __getitem__(self, key: Any) -> _MockObject:
59
60
return _make_subclass (str (key ), self .__display_name__ , self .__class__ )()
60
61
61
62
def __getattr__ (self , key : str ) -> _MockObject :
63
+ if key in self .__sphinx_empty_attrs__ :
64
+ return self .__getattribute__ (key )
62
65
return _make_subclass (key , self .__display_name__ , self .__class__ )()
63
66
64
67
def __call__ (self , * args : Any , ** kwargs : Any ) -> Any :
You can’t perform that action at this time.
0 commit comments