import warnings


def deprecated(f):
    def _deprecated(*args, **kwargs):
        message = "Method '%s' is deprecated and will be " \
            "removed in the next major version of django-oscar" \
            % f.__name__
        warnings.warn(message, DeprecationWarning, stacklevel=2)
        return f(*args, **kwargs)
    return _deprecated

@@ -1,343 +1,1098 @@
-import warnings%0A%0A%0Adef deprecated(f):%0A    def _deprecated(*args, **kwargs):%0A        message = %22Method '%25s' is deprecated and will be %22 %5C%0A            %22removed in the next major version of django-oscar%22 %5C%0A            %25 f.__name__%0A        warnings.warn(message, DeprecationWarning, stacklevel=2)%0A        return f(*args, **kwargs)%0A    return _d
+try:%0A    from types import ClassType%0Aexcept ImportError:%0A    # Python 3%0A    CHECK_TYPES = (type,)%0Aelse:%0A    # Python 2: new and old-style classes%0A    CHECK_TYPES = (type, ClassType)%0Aimport warnings%0A%0A%0Adef deprecated(obj):%0A    if isinstance(obj, CHECK_TYPES):%0A        return _deprecated_cls(cls=obj)%0A    else:%0A        return _deprecated_func(f=obj)%0A%0A%0Adef _deprecated_func(f):%0A    def _deprecated(*args, **kwargs):%0A        message = %22Method '%25s' is deprecated and will be %22 %5C%0A            %22removed in the next major version of django-oscar%22 %5C%0A            %25 f.__name__%0A        warnings.warn(message, DeprecationWarning, stacklevel=2)%0A        return f(*args, **kwargs)%0A    return _deprecated%0A%0A%0Adef _deprecated_cls(cls):%0A    class Deprecated(cls):%0A        def __init__(self, *args, **kwargs):%0A            message = %22Class '%25s' is deprecated and will be %22 %5C%0A                %22removed in the next major version of django-oscar%22 %5C%0A                %25 cls.__name__%0A            warnings.warn(message, DeprecationWarning, stacklevel=2)%0A            super(Deprecated, self).__init__(*args, **kwargs)%0A    return D
 epre

make decorator safe for classes