1
0
mirror of https://github.com/django/django.git synced 2024-12-24 18:16:19 +00:00

Imported reduce from functools for forward compatibility.

In Python 3, reduce has to be imported from functools.
This commit is contained in:
Claude Paroz 2012-05-20 00:24:21 +02:00
parent 4b58e94f27
commit 35e6585568
3 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import operator import operator
from functools import reduce
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage from django.core.paginator import InvalidPage

View File

@ -1,6 +1,7 @@
""" """
Global Django exception and warning classes. Global Django exception and warning classes.
""" """
from functools import reduce
class DjangoRuntimeWarning(RuntimeWarning): class DjangoRuntimeWarning(RuntimeWarning):
pass pass

View File

@ -8,6 +8,7 @@ import hashlib
import binascii import binascii
import operator import operator
import time import time
from functools import reduce
# Use the system PRNG if possible # Use the system PRNG if possible
import random import random