Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

PY3 fix downloader slots GC

Mikhail Korobovf9dc02e23ae3
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()