From f9dc02e23ae35e5ba9dce74dcc2571d02e90eb22 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Thu, 28 Jan 2016 02:59:23 +0500 Subject: [PATCH] PY3 fix downloader slots GC --- scrapy/core/downloader/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapy/core/downloader/__init__.py b/scrapy/core/downloader/__init__.py index 8beb08159..d835e65f7 100644 --- a/scrapy/core/downloader/__init__.py +++ b/scrapy/core/downloader/__init__.py @@ -194,6 +194,6 @@ class Downloader(object): def _slot_gc(self, age=60): mintime = time() - age - for key, slot in self.slots.items(): + for key, slot in list(self.slots.items()): if not slot.active and slot.lastseen + slot.delay < mintime: self.slots.pop(key).close()