Scrapy, a fast high-level web crawling & scraping framework for Python.
PY3 disable scrapy.telnet if twisted.conch is not available
Mikhail Korobov378b6efc0e0f
diff --git a/scrapy/telnet.py b/scrapy/telnet.pyindex d2617f69d..7b73a42ac 100644--- a/scrapy/telnet.py+++ b/scrapy/telnet.py@@ -6,9 +6,13 @@ See documentation in docs/topics/telnetconsole.rstimport pprint-from twisted.conch import manhole, telnet-from twisted.conch.insults import insultsfrom twisted.internet import protocol+try:+ from twisted.conch import manhole, telnet+ from twisted.conch.insults import insults+ TWISTED_CONCH_AVAILABLE = True+except ImportError:+ TWISTED_CONCH_AVAILABLE = Falsefrom scrapy.exceptions import NotConfiguredfrom scrapy import log, signals@@ -32,6 +36,8 @@ class TelnetConsole(protocol.ServerFactory):def __init__(self, crawler):if not crawler.settings.getbool('TELNETCONSOLE_ENABLED'):raise NotConfigured+ if not TWISTED_CONCH_AVAILABLE:+ raise NotConfiguredself.crawler = crawlerself.noisy = Falseself.portrange = [int(x) for x in crawler.settings.getlist('TELNETCONSOLE_PORT')]diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txtindex f3c667cd0..70cf22c79 100644--- a/tests/py3-ignores.txt+++ b/tests/py3-ignores.txt@@ -97,5 +97,4 @@ scrapy/contrib/statsmailer.pyscrapy/contrib/memusage.pyscrapy/commands/deploy.pyscrapy/commands/bench.py-scrapy/telnet.pyscrapy/mail.py