mirror of https://github.com/scrapy/scrapy.git
Don't fail if twisted is not available on scrapy/__init__.py, to avoid making setup.py depend on Twisted. Closes #256
This commit is contained in:
parent
61ab9b86b7
commit
4bbcbd7b77
|
|
@ -16,8 +16,11 @@ warnings.filterwarnings('ignore', category=DeprecationWarning, module='twisted')
|
|||
|
||||
# prevents noisy (and innocent) dropin.cache errors when loading spiders from
|
||||
# egg files using the old Spider Manager. TODO: Remove for Scrapy 0.11
|
||||
from twisted.python.zippath import ZipPath
|
||||
ZipPath.setContent = lambda x, y: None
|
||||
try:
|
||||
from twisted.python.zippath import ZipPath
|
||||
ZipPath.setContent = lambda x, y: None
|
||||
except ImportError: # to avoid making setup.py depend on Twisted
|
||||
pass
|
||||
|
||||
# monkey patches to fix external library issues
|
||||
from scrapy.xlib import twisted_250_monkeypatches, urlparse_monkeypatches
|
||||
|
|
|
|||
Loading…
Reference in New Issue