summaryrefslogtreecommitdiff
path: root/dedup/hashing.py
diff options
context:
space:
mode:
Diffstat (limited to 'dedup/hashing.py')
-rw-r--r--dedup/hashing.py6
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""