From 80b3665dfd8353143a2b5b1bcd2d20b53887c965 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 10 Mar 2015 09:44:35 +0000 Subject: [PATCH] Use functools.reduce instead of reduce reduce() no longer exists in python 3 --- wagtail/wagtailcore/management/commands/fixtree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtailcore/management/commands/fixtree.py b/wagtail/wagtailcore/management/commands/fixtree.py index f32208e73..a3152d3bd 100644 --- a/wagtail/wagtailcore/management/commands/fixtree.py +++ b/wagtail/wagtailcore/management/commands/fixtree.py @@ -1,4 +1,5 @@ import operator +import functools from optparse import make_option from django.core.management.base import BaseCommand @@ -52,7 +53,7 @@ class Command(BaseCommand): filter_conditions.append(Q(path__startswith=path)) # combine filter_conditions into a single ORed condition - final_filter = reduce(operator.or_, filter_conditions) + final_filter = functools.reduce(operator.or_, filter_conditions) # build a queryset of all pages to be removed; this must be a vanilla Django # queryset rather than a treebeard MP_NodeQuerySet, so that we bypass treebeard's