From d5dcc5eaef80ef383dff90f19349c0e06f1836a6 Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Fri, 9 Aug 2019 00:30:58 -0300 Subject: [PATCH] Import twisted.web.client.URI directly --- scrapy/core/downloader/handlers/http11.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py index f0ed1a4af..9da20e032 100644 --- a/scrapy/core/downloader/handlers/http11.py +++ b/scrapy/core/downloader/handlers/http11.py @@ -13,12 +13,8 @@ from twisted.web.http_headers import Headers as TxHeaders from twisted.web.iweb import IBodyProducer, UNKNOWN_LENGTH from twisted.internet.error import TimeoutError from twisted.web.http import _DataLoss, PotentialDataLoss -from twisted.web.client import Agent, ProxyAgent, ResponseDone, \ - HTTPConnectionPool, ResponseFailed -try: - from twisted.web.client import URI -except ImportError: - from twisted.web.client import _URI as URI +from twisted.web.client import (Agent, ProxyAgent, ResponseDone, + HTTPConnectionPool, ResponseFailed, URI) from twisted.internet.endpoints import TCP4ClientEndpoint from scrapy.http import Headers