diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-09-16 12:57:37 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-09-22 11:59:15 -0700 |
commit | 696f3c1289d7818ae04fe5011dfc71e5ee9c9f1f (patch) | |
tree | e5f4c4bfa8e86ba71279f0ecb698da2f9a62fb7a /oslo | |
parent | cc7ae9fecc705924c4dc1d8d104338afc0e2437e (diff) | |
download | oslo-db-696f3c1289d7818ae04fe5011dfc71e5ee9c9f1f.tar.gz |
Use six.wraps instead of functools.wraps
The six module provides a helper wraps function that correctly
tracks the original wrapped function in python 2.x and 3.x so
use it where we can so that we maintain better compatability with
3.x
Change-Id: Ifa994bf63153f58f0aa1f6203a963ac7312ac2b1
Diffstat (limited to 'oslo')
-rw-r--r-- | oslo/db/api.py | 4 | ||||
-rw-r--r-- | oslo/db/sqlalchemy/test_base.py | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/oslo/db/api.py b/oslo/db/api.py index 5527e64..8b7bdeb 100644 --- a/oslo/db/api.py +++ b/oslo/db/api.py @@ -23,12 +23,12 @@ takes no arguments. The method can return any object that implements DB API methods. """ -import functools import logging import threading import time from oslo.utils import importutils +import six from oslo.db._i18n import _LE from oslo.db import exception @@ -93,7 +93,7 @@ class wrap_db_retry(object): self.max_retry_interval = max_retry_interval def __call__(self, f): - @functools.wraps(f) + @six.wraps(f) def wrapper(*args, **kwargs): next_interval = self.retry_interval remaining = self.max_retries diff --git a/oslo/db/sqlalchemy/test_base.py b/oslo/db/sqlalchemy/test_base.py index 849e726..52f2673 100644 --- a/oslo/db/sqlalchemy/test_base.py +++ b/oslo/db/sqlalchemy/test_base.py @@ -14,7 +14,6 @@ # under the License. import abc -import functools import os import fixtures @@ -83,7 +82,7 @@ def backend_specific(*dialects): ::dialects: list of dialects names under which the test will be launched. """ def wrap(f): - @functools.wraps(f) + @six.wraps(f) def ins_wrap(self): if not set(dialects).issubset(ALLOWED_DIALECTS): raise ValueError( |