From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/spdk/scripts/rpc/helpers.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/spdk/scripts/rpc/helpers.py (limited to 'src/spdk/scripts/rpc/helpers.py') diff --git a/src/spdk/scripts/rpc/helpers.py b/src/spdk/scripts/rpc/helpers.py new file mode 100644 index 000000000..d931fcf14 --- /dev/null +++ b/src/spdk/scripts/rpc/helpers.py @@ -0,0 +1,16 @@ +import sys + +deprecated_aliases = {} + + +def deprecated_alias(old_name): + def wrap(f): + def old_f(*args, **kwargs): + ret = f(*args, **kwargs) + print("{} is deprecated, use {} instead.".format(old_name, f.__name__), file=sys.stderr) + return ret + old_f.__name__ = old_name + deprecated_aliases[old_name] = f.__name__ + setattr(sys.modules[f.__module__], old_name, old_f) + return f + return wrap -- cgit v1.2.3