From c1e474d9ef478fad505e3d3a5985f191f78fdc81 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 7 May 2019 12:35:48 +0200 Subject: [PATCH] documentation/python: don't cut off the last character in a warning. I mistakenly thought a[:-1] is the same as a[:]. It isn't. --- documentation/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/python.py b/documentation/python.py index 15c3131a..d16a2021 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -236,7 +236,7 @@ def parse_pybind_signature(signature: str) -> Tuple[str, str, List[Tuple[str, st # Failed to parse, return an ellipsis and docs if not signature.startswith(', '): end = original_signature.find('\n') - logging.warning("cannot parse pybind11 function signature %s", original_signature[:end]) + logging.warning("cannot parse pybind11 function signature %s", original_signature[:end if end != -1 else None]) if end != -1 and len(original_signature) > end + 1 and original_signature[end + 1] == '\n': summary = extract_summary(original_signature[end + 1:]) else: @@ -258,7 +258,7 @@ def parse_pybind_signature(signature: str) -> Tuple[str, str, List[Tuple[str, st if signature and signature[0] != '\n': end = original_signature.find('\n') - logging.warning("cannot parse pybind11 function signature %s", original_signature[:end]) + logging.warning("cannot parse pybind11 function signature %s", original_signature[:end if end != -1 else None]) if end != -1 and len(original_signature) > end + 1 and original_signature[end + 1] == '\n': summary = extract_summary(original_signature[end + 1:]) else: -- 2.30.2