You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
554 B
26 lines
554 B
5 years ago
|
# -*- coding: utf-8 -*-
|
||
|
from __future__ import absolute_import
|
||
|
import functools
|
||
|
import warnings
|
||
|
|
||
|
|
||
|
class RemovedInMarshmallow3Warning(DeprecationWarning):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class ChangedInMarshmallow3Warning(FutureWarning):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def unused_and_removed_in_ma3(f):
|
||
|
@functools.wraps(f)
|
||
|
def wrapped(*args, **kwargs):
|
||
|
warnings.warn(
|
||
|
'{} is unused and is removed in marshmallow 3.'.format(f.__name__),
|
||
|
RemovedInMarshmallow3Warning,
|
||
|
stacklevel=2,
|
||
|
)
|
||
|
return f(*args, **kwargs)
|
||
|
|
||
|
return wrapped
|