Skip to content

Commit

Permalink
not QUITE ready to drop py2.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Mar 5, 2015
1 parent 2dbdc19 commit d478d84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dedupe/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def dedupeSamplePredicates(sample_size, predicates, items) :
continue

items.rotate(random.randrange(n_items))
items.reverse()
try : # the reverse method was only added in python 2.7
items.reverse()
except AttributeError :
items = deque(reversed(items))

yield dedupeSamplePredicate(subsample_size,
predicate,
Expand Down

0 comments on commit d478d84

Please sign in to comment.