From df734fc17b0f7a429bbfc028f208cb4e64445f39 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 30 Apr 2020 16:08:51 +0200 Subject: [deprecation] 'moved' function renamed 'callable_moved' --- logilab/common/deprecation.py | 5 ++++- 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']) -- cgit v1.2.1