Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slightly more defensive code for thread safety (issue #7).

  • Loading branch information...
commit fffd5b60a1b3dde980766a20382369e8ae7a4f19 1 parent 26c611a
@shazow authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 urllib3/_collections.py
View
5 urllib3/_collections.py
@@ -60,7 +60,6 @@ def _push_entry(self, key):
self._invalidate_entry(key)
new_entry = AccessEntry(key)
-
self.access_lookup[key] = new_entry
self.access_log_lock.acquire()
@@ -77,8 +76,8 @@ def _prune_entries(self, num):
if not p.is_valid:
continue # Invalidated entry, skip
- del self._container[p.key]
- del self.access_lookup[p.key]
+ self._container.pop(p.key, None)
+ self.access_lookup.pop(p.key, None)
num -= 1
def _prune_invalidated_entries(self):

0 comments on commit fffd5b6

Please sign in to comment.
Something went wrong with that request. Please try again.