diff options
author | Helmut Grohne <helmut@subdivi.de> | 2015-04-16 17:44:31 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2015-04-16 17:44:31 +0200 |
commit | c96530adeec7b72b34d0069e1aa8473b3994e801 (patch) | |
tree | 949c858363c4f6513879f3125edf3c6ec050a320 | |
parent | 8525a815c11af8f87f2beef7987650738dbc620c (diff) | |
download | debian-dedup-c96530adeec7b72b34d0069e1aa8473b3994e801.tar.gz |
there is no itertools.imap in py3k
-rw-r--r-- | dedup/hashing.py | 6 |
1 files changed, 5 insertions, 1 deletions
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"" |