From 6e56d1bd57b5a18fe1ae0b4f7a9c0ab9f2e8743b Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Thu, 1 Sep 2022 13:45:26 +0800 Subject: [PATCH] chore(mge/deprecated): add __deprecated__ attr for condition case GitOrigin-RevId: 6d8e7398e4a06ee90c0bdbebec3f0290c12b5aa4 --- imperative/python/megengine/utils/deprecation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imperative/python/megengine/utils/deprecation.py b/imperative/python/megengine/utils/deprecation.py index f9ed8bdf5..7978a1b33 100644 --- a/imperative/python/megengine/utils/deprecation.py +++ b/imperative/python/megengine/utils/deprecation.py @@ -33,6 +33,7 @@ def deprecated_func(version, origin, name, tbd): ) return func(*args, **kwargs) + wrapper.__deprecated__ = True return wrapper @@ -57,6 +58,7 @@ def deprecated_kwargs_default(version, kwargs_name, kwargs_pos): ) return func(*args, **kwargs) + wrapper.__deprecated__ = True return wrapper return deprecated -- GitLab