aboutsummaryrefslogtreecommitdiff
path: root/urllib3/_collections.py
diff options
context:
space:
mode:
authorSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:41 -0700
committerSVN-Git Migration <python-modules-team@lists.alioth.debian.org>2015-10-08 13:19:41 -0700
commitb6ab7bae87b22c6fae783e8850533219d3bf8a29 (patch)
tree472a760e2e976ea3e9545e09584392accee9cd6d /urllib3/_collections.py
parent54bdd56778a37ea9d56d451d4ae49b99cbbfceaa (diff)
downloadpython-urllib3-b6ab7bae87b22c6fae783e8850533219d3bf8a29.tar
python-urllib3-b6ab7bae87b22c6fae783e8850533219d3bf8a29.tar.gz
Imported Upstream version 1.10
Diffstat (limited to 'urllib3/_collections.py')
-rw-r--r--urllib3/_collections.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/urllib3/_collections.py b/urllib3/_collections.py
index d77ebb8..784342a 100644
--- a/urllib3/_collections.py
+++ b/urllib3/_collections.py
@@ -14,7 +14,7 @@ try: # Python 2.7+
from collections import OrderedDict
except ImportError:
from .packages.ordered_dict import OrderedDict
-from .packages.six import itervalues
+from .packages.six import iterkeys, itervalues
__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']
@@ -85,8 +85,7 @@ class RecentlyUsedContainer(MutableMapping):
def clear(self):
with self.lock:
# Copy pointers to all values, then wipe the mapping
- # under Python 2, this copies the list of values twice :-|
- values = list(self._container.values())
+ values = list(itervalues(self._container))
self._container.clear()
if self.dispose_func:
@@ -95,7 +94,7 @@ class RecentlyUsedContainer(MutableMapping):
def keys(self):
with self.lock:
- return self._container.keys()
+ return list(iterkeys(self._container))
class HTTPHeaderDict(MutableMapping):