From 4adfaced6ae82db8ba38c33daefa06d5ffafdf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Tue, 22 Nov 2016 09:41:20 -0300 Subject: [PATCH] Use Twisted modules for client and endpoints --- scrapy/xlib/tx/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scrapy/xlib/tx/__init__.py b/scrapy/xlib/tx/__init__.py index 1ac4e0108..e73378232 100644 --- a/scrapy/xlib/tx/__init__.py +++ b/scrapy/xlib/tx/__init__.py @@ -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