Skip to content
This repository was archived by the owner on Mar 24, 2021. It is now read-only.

Use functools to mark the _check_handler decorator as a wrapper #1000

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pykafka/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
limitations under the License.
"""
__all__ = ["Broker"]
import functools
import logging
import time

Expand All @@ -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
Expand Down