Fix `scrapy shell`.

This commit is contained in:
Andrey Rakhmatullin 2023-09-24 19:36:29 +04:00
parent 0c6440a427
commit 0630e4aaa1
1 changed files with 3 additions and 3 deletions

View File

@ -404,8 +404,8 @@ class CrawlerProcess(CrawlerRunner):
:param bool stop_after_crawl: stop or not the reactor when all
crawlers have finished
:param bool install_signal_handlers: whether to install the shutdown
handlers (default: True)
:param bool install_signal_handlers: whether to install the OS signal
handlers from Twisted and Scrapy (default: True)
"""
from twisted.internet import reactor
@ -426,7 +426,7 @@ class CrawlerProcess(CrawlerRunner):
reactor.addSystemEventTrigger(
"after", "startup", install_shutdown_handlers, self._signal_shutdown
)
reactor.run() # blocking call
reactor.run(installSignalHandlers=install_signal_handlers) # blocking call
def _graceful_stop_reactor(self) -> Deferred:
d = self.stop()