summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 43d6caa..72e91dd 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1911,7 +1911,7 @@ class URLopener:
# XXX thread unsafe!
if len(self.ftpcache) > MAXFTPCACHE:
# Prune the cache, rather arbitrarily
- for k in self.ftpcache.keys():
+ for k in list(self.ftpcache):
if k != key:
v = self.ftpcache[k]
del self.ftpcache[k]