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:
Pablo Hoffman 2010-10-05 12:43:34 -02:00
parent 61ab9b86b7
commit 4bbcbd7b77
1 changed files with 5 additions and 2 deletions

View File

@ -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