better deprecation warning for Response.body_as_unicode() (#4579)

This commit is contained in:
Mikhail Korobov 2020-05-18 22:12:31 +05:00 committed by GitHub
parent 314adf6c38
commit bcc40c4077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class TextResponse(Response):
"""Return body as unicode"""
warnings.warn('Response.body_as_unicode() is deprecated, '
'please use Response.text instead.',
ScrapyDeprecationWarning)
ScrapyDeprecationWarning, stacklevel=2)
return self.text
@property