mirror of https://github.com/scrapy/scrapy.git
10 lines
375 B
Python
10 lines
375 B
Python
"""Some helpers for deprecation messages"""
|
|
|
|
import warnings
|
|
|
|
def attribute(obj, oldattr, newattr, version='0.12'):
|
|
cname = obj.__class__.__name__
|
|
warnings.warn("%s.%s attribute is deprecated and will be no longer supported "
|
|
"in Scrapy %s, use %s.%s attribute instead" % \
|
|
(cname, oldattr, version, cname, newattr), DeprecationWarning, stacklevel=3)
|