From 723c3f9fd209a2e92832a3453ec07c03d0b6df8c Mon Sep 17 00:00:00 2001 From: Spencer Nelson Date: Thu, 7 May 2020 15:59:36 -0700 Subject: [PATCH] Use functools to mark the _check_handler decorator as a wrapper Using @functools.wrap ensures that docstrings for wrapped functions are passed through the decorator correctly. --- pykafka/broker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pykafka/broker.py b/pykafka/broker.py index bfcdfd15c..50b42f81d 100644 --- a/pykafka/broker.py +++ b/pykafka/broker.py @@ -17,6 +17,7 @@ limitations under the License. """ __all__ = ["Broker"] +import functools import logging import time @@ -39,6 +40,7 @@ def _check_handler(fn): """Ensures that self._req_handler is not None before calling fn""" + @functools.wraps(fn) def wrapped(self, *args, **kwargs): if self._req_handler is None: raise SocketDisconnectedError