diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-04-30 16:08:51 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-04-30 16:08:51 +0200 |
commit | df734fc17b0f7a429bbfc028f208cb4e64445f39 (patch) | |
tree | c756f0f9e6925522fcb420516fe76bb180f90f07 | |
parent | e4e0dfe5630342b8983836fa2f038207ceeefd7c (diff) | |
download | logilab-common-df734fc17b0f7a429bbfc028f208cb4e64445f39.tar.gz |
[deprecation] 'moved' function renamed 'callable_moved'
-rw-r--r-- | logilab/common/deprecation.py | 5 | ||||
-rw-r--r-- | test/unittest_deprecation.py | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/logilab/common/deprecation.py b/logilab/common/deprecation.py index 48f3202..bb7e429 100644 --- a/logilab/common/deprecation.py +++ b/logilab/common/deprecation.py @@ -255,7 +255,7 @@ def argument_renamed(old_name, new_name, version=None): @argument_renamed(old_name="modpath", new_name="module_path") @argument_renamed(old_name="objname", new_name="object_name") -def moved(module_name, object_name, version=None, stacklevel=2): +def callable_moved(module_name, object_name, version=None, stacklevel=2): """use to tell that a callable has been moved to a new module. It returns a callable wrapper, so that when its called a warning is printed @@ -279,6 +279,9 @@ def moved(module_name, object_name, version=None, stacklevel=2): return callnew +moved = callable_renamed(old_name="moved", new_function="callable_moved") + + def class_renamed(old_name, new_class, message=None, version=None): """automatically creates a class which fires a DeprecationWarning when instantiated. diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py index 597b021..096978e 100644 --- a/test/unittest_deprecation.py +++ b/test/unittest_deprecation.py @@ -157,7 +157,7 @@ class RawInputTC(TestCase): def test_moved(self): module = 'data.deprecation' - any_func = deprecation.moved(module, 'moving_target') + any_func = deprecation.callable_moved(module, 'moving_target') any_func() self.assertEqual(self.messages, ['[logilab.common] object moving_target has been moved to module data.deprecation']) |