Scrapy, a fast high-level web crawling & scraping framework for Python.
Catch SyntaxError as well when importing manhole
Konstantin Lopuhin17e9914b8a12
diff --git a/requirements-py3.txt b/requirements-py3.txtindex b941fd867..b38c4cc09 100644--- a/requirements-py3.txt+++ b/requirements-py3.txt@@ -1,4 +1,4 @@-git+https://github.com/lopuhin/twisted.git@9384-remove-async-param+Twisted>=17.9.0lxml>=3.2.4pyOpenSSL>=0.13.1cssselect>=0.9diff --git a/scrapy/extensions/telnet.py b/scrapy/extensions/telnet.pyindex e78afa1fc..7cc8f823a 100644--- a/scrapy/extensions/telnet.py+++ b/scrapy/extensions/telnet.py@@ -12,7 +12,7 @@ try:from twisted.conch import manhole, telnetfrom twisted.conch.insults import insultsTWISTED_CONCH_AVAILABLE = True-except ImportError:+except (ImportError, SyntaxError):TWISTED_CONCH_AVAILABLE = Falsefrom scrapy.exceptions import NotConfigured@@ -40,7 +40,8 @@ class TelnetConsole(protocol.ServerFactory):if not crawler.settings.getbool('TELNETCONSOLE_ENABLED'):raise NotConfiguredif not TWISTED_CONCH_AVAILABLE:- raise NotConfigured+ raise NotConfigured('TelnetConsole not enabled: failed to import '+ 'required twisted modules.')self.crawler = crawlerself.noisy = Falseself.portrange = [int(x) for x in crawler.settings.getlist('TELNETCONSOLE_PORT')]