mirror of https://github.com/scrapy/scrapy.git
Use Twisted modules for client and endpoints
This commit is contained in:
parent
d62776a858
commit
4adfaced6a
|
|
@ -1,14 +1,16 @@
|
||||||
from scrapy import twisted_version
|
from scrapy import twisted_version
|
||||||
if twisted_version > (13, 0, 0):
|
if twisted_version >= (13, 1, 0):
|
||||||
from twisted.web import client
|
from twisted.web import client
|
||||||
from twisted.internet import endpoints
|
from twisted.internet import endpoints
|
||||||
if twisted_version >= (11, 1, 0):
|
elif twisted_version >= (11, 1, 0):
|
||||||
from . import client, endpoints
|
from . import client, endpoints
|
||||||
else:
|
else:
|
||||||
from scrapy.exceptions import NotSupported
|
from scrapy.exceptions import NotSupported
|
||||||
|
|
||||||
class _Mocked(object):
|
class _Mocked(object):
|
||||||
def __init__(self, *args, **kw):
|
def __init__(self, *args, **kw):
|
||||||
raise NotSupported('HTTP1.1 not supported')
|
raise NotSupported('HTTP1.1 not supported')
|
||||||
|
|
||||||
class _Mock(object):
|
class _Mock(object):
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return _Mocked
|
return _Mocked
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue