Use Twisted modules for client and endpoints

This commit is contained in:
Daniel Graña 2016-11-22 09:41:20 -03:00
parent d62776a858
commit 4adfaced6a
1 changed files with 4 additions and 2 deletions

View File

@ -1,14 +1,16 @@
from scrapy import twisted_version
if twisted_version > (13, 0, 0):
if twisted_version >= (13, 1, 0):
from twisted.web import client
from twisted.internet import endpoints
if twisted_version >= (11, 1, 0):
elif twisted_version >= (11, 1, 0):
from . import client, endpoints
else:
from scrapy.exceptions import NotSupported
class _Mocked(object):
def __init__(self, *args, **kw):
raise NotSupported('HTTP1.1 not supported')
class _Mock(object):
def __getattr__(self, name):
return _Mocked