Skip to content

Commit

Permalink
Add functools.wraps to BGAPI decorator
Browse files Browse the repository at this point in the history
We had this on the gatttool backend, but not bgapi. Using this preserves
the docstring of the original method.
  • Loading branch information
peplin committed Feb 21, 2021
1 parent 538c24f commit 0a8edec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pygatt/backends/bgapi/device.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import functools
import logging
import time

Expand All @@ -15,6 +16,7 @@ def connection_required(func):
"""Raise an exception if the device is not connected before calling the
actual function.
"""
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
if self._handle is None:
raise exceptions.NotConnectedError()
Expand Down

0 comments on commit 0a8edec

Please sign in to comment.