Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use 'six.wraps' vs. 'functools.wraps' #37

Merged
merged 1 commit into from
Jun 29, 2021
Merged
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
7 changes: 3 additions & 4 deletions test_utils/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import time
from functools import wraps

import six

Expand Down Expand Up @@ -94,7 +93,7 @@ def __init__(
self.error_predicate = error_predicate

def __call__(self, to_wrap):
@wraps(to_wrap)
@six.wraps(to_wrap)
def wrapped_function(*args, **kwargs):
tries = 0
while tries < self.max_tries:
Expand Down Expand Up @@ -152,7 +151,7 @@ def __init__(
self.result_predicate = result_predicate

def __call__(self, to_wrap):
@wraps(to_wrap)
@six.wraps(to_wrap)
def wrapped_function(*args, **kwargs):
tries = 0
while tries < self.max_tries:
Expand Down Expand Up @@ -209,7 +208,7 @@ def __init__(
def __call__(self, to_wrap):
instance = to_wrap.__self__ # only instance methods allowed

@wraps(to_wrap)
@six.wraps(to_wrap)
def wrapped_function(*args, **kwargs):
tries = 0
while tries < self.max_tries:
Expand Down