Skip to content

Commit df511b5

Browse files
authored
Fix exception when __doc__ is None with portable Python (#1550)
* Fix unset __doc__ concatenation error Signed-off-by: Rob Szabo <[email protected]>
1 parent f7b5855 commit df511b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/py-opentimelineio/opentimelineio/core/_core_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ def __deepcopy__(self, memo):
177177

178178
# Hide the method frm Sphinx doc.
179179
# See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists # noqa
180-
getattr(mapClass, name).__doc__ += '\n\n:meta private:'
180+
# __doc__ will be None on a Windows embeddable package where the built-in modules are provided # noqa
181+
# as pyc files which do not include the docstrings.
182+
if getattr(mapClass, name).__doc__ is not None:
183+
getattr(mapClass, name).__doc__ += "\n\n:meta private:"
181184

182185
mapClass.setdefault = setdefault
183186
mapClass.pop = pop
@@ -329,7 +332,10 @@ def insert(self, index, item):
329332

330333
# Hide the method frm Sphinx doc.
331334
# See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists # noqa
332-
getattr(sequenceClass, name).__doc__ += '\n\n:meta private:'
335+
# __doc__ will be None on a Windows embeddable package where the built-in modules are provided # noqa
336+
# as pyc files which do not include the docstrings.
337+
if getattr(sequenceClass, name).__doc__ is not None:
338+
getattr(sequenceClass, name).__doc__ += "\n\n:meta private:"
333339

334340
if not issubclass(sequenceClass, SerializableObject):
335341
def __copy__(self):

0 commit comments

Comments
 (0)