Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1774 from scrapy/backport-1.1
- Loading branch information
Showing
11 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from __future__ import absolute_import | ||
|
||
import warnings | ||
from scrapy.exceptions import ScrapyDeprecationWarning | ||
|
||
from pydispatch import ( | ||
dispatcher, | ||
errors, | ||
robust, | ||
robustapply, | ||
saferef, | ||
) | ||
|
||
warnings.warn("Importing from scrapy.xlib.pydispatch is deprecated and will" | ||
" no longer be supported in future Scrapy versions." | ||
" If you just want to connect signals use the from_crawler class method," | ||
" otherwise import pydispatch directly if needed." | ||
" See: https://github.com/scrapy/scrapy/issues/1762", | ||
ScrapyDeprecationWarning, stacklevel=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import unittest | ||
import warnings | ||
from six.moves import reload_module | ||
|
||
|
||
class DeprecatedPydispatchTest(unittest.TestCase): | ||
def test_import_xlib_pydispatch_show_warning(self): | ||
with warnings.catch_warnings(record=True) as w: | ||
from scrapy.xlib import pydispatch | ||
reload_module(pydispatch) | ||
self.assertIn('Importing from scrapy.xlib.pydispatch is deprecated', | ||
str(w[0].message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters