aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/concurrent
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/concurrent')
-rw-r--r--Lib/concurrent/interpreters/_crossinterp.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/Lib/concurrent/interpreters/_crossinterp.py b/Lib/concurrent/interpreters/_crossinterp.py
index f47eb693ac8..a5f46b20fbb 100644
--- a/Lib/concurrent/interpreters/_crossinterp.py
+++ b/Lib/concurrent/interpreters/_crossinterp.py
@@ -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)