diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-09 04:34:13 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-09 04:34:13 -0700 |
commit | b10f64b04240172700bc3a4e3903fd557fdf6ae9 (patch) | |
tree | c0d507b69524ae98495b4811d363b6870e7bf07c | |
parent | c0f7f00ddcfba8e671e9298dd625ee682c661a3d (diff) | |
download | portage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.tar.gz portage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.tar.bz2 portage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.zip |
Import ifilterfalse as filterfalse, for python3 compatibility.
-rw-r--r-- | pym/portage/util/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 2a2597b1a..c1658566c 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -14,7 +14,10 @@ __all__ = ['apply_permissions', 'apply_recursive_permissions', import codecs from copy import deepcopy import errno -from itertools import ifilterfalse +try: + from itertools import filterfalse +except ImportError: + from itertools import ifilterfalse as filterfalse import logging import re import shlex @@ -737,7 +740,7 @@ def unique_everseen(iterable, key=None): seen = set() seen_add = seen.add if key is None: - for element in ifilterfalse(seen.__contains__, iterable): + for element in filterfalse(seen.__contains__, iterable): seen_add(element) yield element else: |