diff --git a/CHANGES.md b/CHANGES.md index fab8f653..ed3b208d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,8 @@ missing version query functions. https://github.com/joblib/threadpoolctl/pull/88 +- Fixed an attribute error when python is run with -OO. + https://github.com/joblib/threadpoolctl/pull/87 2.2.0 (2021-07-09) ================== diff --git a/threadpoolctl.py b/threadpoolctl.py index 94db2989..d32d6697 100644 --- a/threadpoolctl.py +++ b/threadpoolctl.py @@ -98,7 +98,8 @@ class _dl_phdr_info(ctypes.Structure): def _format_docstring(*args, **kwargs): def decorator(o): - o.__doc__ = o.__doc__.format(*args, **kwargs) + if o.__doc__ is not None: + o.__doc__ = o.__doc__.format(*args, **kwargs) return o return decorator