From f34f4ee9ed83b29965b4136dfc70ad3d3390e9d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 14 Jul 2019 14:13:23 +0200 Subject: [PATCH] documentation/python: attrs does bad things and I'm not happy about that. --- documentation/python.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- 2.30.2