MCPcopy Create free account
hub / github.com/StackStorm/st2 / deprecated

Function deprecated

st2common/st2common/util/deprecation.py:20–37  ·  view source on GitHub ↗

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

(func)

Source from the content-addressed store, hash-verified

18
19
20def deprecated(func):
21 """
22 This is a decorator which can be used to mark functions
23 as deprecated. It will result in a warning being emitted
24 when the function is used.
25 """
26
27 def new_func(*args, **kwargs):
28 warnings.warn(
29 "Call to deprecated function {}.".format(func.__name__),
30 category=DeprecationWarning,
31 )
32 return func(*args, **kwargs)
33
34 new_func.__name__ = func.__name__
35 new_func.__doc__ = func.__doc__
36 new_func.__dict__.update(func.__dict__)
37 return new_func

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected