From d25018b84c2844a5eda2b3ab34ed7723bf71daba Mon Sep 17 00:00:00 2001 From: Matteo Raso Date: Fri, 31 Mar 2023 19:24:10 -0400 Subject: Fixed edge case where pyfunc has no attribute `__doc__` [skip circle] [skip azp] [skip cirrus] --- numpy/lib/function_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/function_base.py') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index b9f0d58d2..90caac062 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -2303,7 +2303,7 @@ class vectorize: self._ufunc = {} # Caching to improve default performance self._doc = None self.__doc__ = doc - if doc is None: + if doc is None and hasattr(pyfunc, '__doc__'): self.__doc__ = pyfunc.__doc__ else: self._doc = doc -- cgit v1.2.1