diff --git a/scrapy/shell.py b/scrapy/shell.py index 515b71bb6..c5a202dfe 100644 --- a/scrapy/shell.py +++ b/scrapy/shell.py @@ -163,7 +163,11 @@ class Shell: def inspect_response(response, spider): """Open a shell to inspect the given response""" + # Shell.start removes the SIGINT handler, so save it and re-add it after + # the shell has closed + sigint_handler = signal.getsignal(signal.SIGINT) Shell(spider.crawler).start(response=response, spider=spider) + signal.signal(signal.SIGINT, sigint_handler) def _request_deferred(request):