From c96530adeec7b72b34d0069e1aa8473b3994e801 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 16 Apr 2015 17:44:31 +0200 Subject: there is no itertools.imap in py3k --- dedup/hashing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dedup') diff --git a/dedup/hashing.py b/dedup/hashing.py index 0b7f889..1419811 100644 --- a/dedup/hashing.py +++ b/dedup/hashing.py @@ -1,4 +1,8 @@ import itertools +try: + from itertools import imap as map +except ImportError: + pass # in python3 map is already imap class HashBlacklist(object): """Turn a hashlib-like object into a hash that returns None for some @@ -50,7 +54,7 @@ class HashBlacklistContent(object): self.blacklist = blacklist if maxlen is None: # the chain avoids passing the empty sequence to max - maxlen = max(itertools.chain((0,), itertools.imap(len, blacklist))) + maxlen = max(itertools.chain((0,), map(len, blacklist))) self.maxlen = maxlen self.stored = b"" -- cgit v1.2.3