This commit is contained in:
Benjamin Peterson 2014-06-07 15:09:36 -07:00
commit edb07d28fb
4 changed files with 35 additions and 2 deletions

View file

@ -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]