Permalink
Browse files

Imported reduce from functools for forward compatibility.

In Python 3, reduce has to be imported from functools.
  • Loading branch information...
1 parent 4b58e94 commit 35e65855680be2c8a495ec926c7eaf992c79edc0 @claudep claudep committed May 19, 2012
Showing with 3 additions and 0 deletions.
  1. +1 −0 django/contrib/admin/views/main.py
  2. +1 −0 django/core/exceptions.py
  3. +1 −0 django/utils/crypto.py
View
1 django/contrib/admin/views/main.py
@@ -1,4 +1,5 @@
import operator
+from functools import reduce
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
View
1 django/core/exceptions.py
@@ -1,6 +1,7 @@
"""
Global Django exception and warning classes.
"""
+from functools import reduce
class DjangoRuntimeWarning(RuntimeWarning):
pass
View
1 django/utils/crypto.py
@@ -8,6 +8,7 @@
import binascii
import operator
import time
+from functools import reduce
# Use the system PRNG if possible
import random

0 comments on commit 35e6585

Please sign in to comment.