Skip to content

Commit

Permalink
Python3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Löffler committed Feb 11, 2015
1 parent b493eeb commit 328d129
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions urllib3/_collections.py
Expand Up @@ -14,7 +14,7 @@ def __exit__(self, exc_type, exc_value, traceback):
from collections import OrderedDict
except ImportError:
from .packages.ordered_dict import OrderedDict
from .packages.six import iterkeys, itervalues
from .packages.six import iterkeys, itervalues, PY3


__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']
Expand Down Expand Up @@ -167,14 +167,17 @@ def __eq__(self, other):
other = type(self)(other)
return dict((k1, self[k1]) for k1 in self) == dict((k2, other[k2]) for k2 in other)

itervalues = MutableMapping.itervalues
iteritems = MutableMapping.iteritems
items = MutableMapping.items
values = MutableMapping.values
get = MutableMapping.get
pop = MutableMapping.pop
update = MutableMapping.update

if not PY3:
itervalues = MutableMapping.itervalues
iteritems = MutableMapping.iteritems


def add(self, key, val):
"""Adds a (name, value) pair, doesn't overwrite the value if it already
exists.
Expand Down

0 comments on commit 328d129

Please sign in to comment.