From 6bbf134a0c5ccdef413b2168fca099e33e460b4a Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Sat, 23 Dec 2023 14:41:28 +0100 Subject: [PATCH] Fix: Handle empty doctrings in optimized mode (#484) --- geoalchemy2/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/geoalchemy2/utils.py b/geoalchemy2/utils.py index d5b21b90..85e7062f 100644 --- a/geoalchemy2/utils.py +++ b/geoalchemy2/utils.py @@ -9,8 +9,9 @@ def authorized_values_in_docstring(**kwargs): """ def inner(func): - for k, v in kwargs.items(): - func.__doc__ = func.__doc__.replace(f"<{k}>", str(v)) + if func.__doc__ is not None: + for k, v in kwargs.items(): + func.__doc__ = func.__doc__.replace(f"<{k}>", str(v)) return func return inner