summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-09 04:34:13 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-09 04:34:13 -0700
commitb10f64b04240172700bc3a4e3903fd557fdf6ae9 (patch)
treec0d507b69524ae98495b4811d363b6870e7bf07c
parentmaintainer-info: Don't print 'no-herd' and don't print anything twice (bug 33... (diff)
downloadportage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.tar.gz
portage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.tar.bz2
portage-b10f64b04240172700bc3a4e3903fd557fdf6ae9.zip
Import ifilterfalse as filterfalse, for python3 compatibility.
-rw-r--r--pym/portage/util/__init__.py7
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: