Skip to content

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

Simplify import + assignment

Eugenio Lacuestad92f1b185809
diff --git a/scrapy/core/downloader/tls.py b/scrapy/core/downloader/tls.py
index 1c3d94b29..4ed482058 100644
--- a/scrapy/core/downloader/tls.py
+++ b/scrapy/core/downloader/tls.py
@@ -29,8 +29,7 @@ openssl_methods = {
if twisted_version < (17, 0, 0):
- from twisted.internet._sslverify import _maybeSetHostNameIndication
- set_tlsext_host_name = _maybeSetHostNameIndication
+ from twisted.internet._sslverify import _maybeSetHostNameIndication as set_tlsext_host_name
else:
def set_tlsext_host_name(connection, hostNameBytes):
connection.set_tlsext_host_name(hostNameBytes)