gh-136434: Fix docs generation of UnboundItem in subinterpreters (#136435)
This commit is contained in:
@@ -40,16 +40,21 @@ class UnboundItem:
|
||||
|
||||
@classonly
|
||||
def singleton(cls, kind, module, name='UNBOUND'):
|
||||
doc = cls.__doc__.replace('cross-interpreter container', kind)
|
||||
doc = doc.replace('cross-interpreter', kind)
|
||||
doc = cls.__doc__
|
||||
if doc:
|
||||
doc = doc.replace(
|
||||
'cross-interpreter container', kind,
|
||||
).replace(
|
||||
'cross-interpreter', kind,
|
||||
)
|
||||
subclass = type(
|
||||
f'Unbound{kind.capitalize()}Item',
|
||||
(cls,),
|
||||
dict(
|
||||
_MODULE=module,
|
||||
_NAME=name,
|
||||
__doc__=doc,
|
||||
),
|
||||
{
|
||||
"_MODULE": module,
|
||||
"_NAME": name,
|
||||
"__doc__": doc,
|
||||
},
|
||||
)
|
||||
return object.__new__(subclass)
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Fix docs generation of ``UnboundItem`` in :mod:`concurrent.interpreters`
|
||||
when running with :option:`-OO`.
|
||||
Reference in New Issue
Block a user