From: Vladimír Vondruš Date: Sun, 14 Jul 2019 12:13:23 +0000 (+0200) Subject: documentation/python: attrs does bad things and I'm not happy about that. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=f34f4ee9ed83b29965b4136dfc70ad3d3390e9d7;p=blog.git documentation/python: attrs does bad things and I'm not happy about that. --- diff --git a/documentation/python.py b/documentation/python.py index 97a8ac94..ef94bf71 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -913,7 +913,10 @@ def extract_function_doc(state: State, parent, path: List[str], function) -> Lis # What's not solvable with metadata, however, are function overloads --- # one function in Python may equal more than one function on the C++ side. # To make the docs usable, list all overloads separately. - if state.config['PYBIND11_COMPATIBILITY'] and function.__doc__.startswith(path[-1]): + # + # Some shitty packages might be setting __doc__ to None (attrs is one of + # them), explicitly check for that first. + if state.config['PYBIND11_COMPATIBILITY'] and function.__doc__ and function.__doc__.startswith(path[-1]): funcs = parse_pybind_docstring(state, path, function.__doc__) overloads = [] for name, summary, args, type in funcs: