Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Import twisted.web.client.URI directly

Eugenio Lacuestad5dcc5eaef80
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