From 868b4c921c3c129085842aafc1857fccdd04f529 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Mon, 2 Sep 2013 12:10:03 +0200 Subject: [PATCH] Used six.moves.zip_longest, new in six 1.4.0. --- django/contrib/gis/db/models/sql/compiler.py | 6 +----- django/db/backends/mysql/compiler.py | 6 +----- django/db/backends/oracle/compiler.py | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py index b2befd44b2..b89df0ae95 100644 --- a/django/contrib/gis/db/models/sql/compiler.py +++ b/django/contrib/gis/db/models/sql/compiler.py @@ -1,15 +1,11 @@ import datetime -try: - from itertools import zip_longest -except ImportError: - from itertools import izip_longest as zip_longest from django.conf import settings from django.db.backends.util import truncate_name, typecast_date, typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import MULTI from django.utils import six -from django.utils.six.moves import zip +from django.utils.six.moves import zip, zip_longest from django.utils import timezone SQLCompiler = compiler.SQLCompiler diff --git a/django/db/backends/mysql/compiler.py b/django/db/backends/mysql/compiler.py index ee7fbe2575..609573442c 100644 --- a/django/db/backends/mysql/compiler.py +++ b/django/db/backends/mysql/compiler.py @@ -1,9 +1,5 @@ -try: - from itertools import zip_longest -except ImportError: - from itertools import izip_longest as zip_longest - from django.db.models.sql import compiler +from django.utils.six.moves import zip_longest class SQLCompiler(compiler.SQLCompiler): diff --git a/django/db/backends/oracle/compiler.py b/django/db/backends/oracle/compiler.py index b6eb80e7ce..0e4af85f22 100644 --- a/django/db/backends/oracle/compiler.py +++ b/django/db/backends/oracle/compiler.py @@ -1,9 +1,5 @@ from django.db.models.sql import compiler -# The izip_longest was renamed to zip_longest in py3 -try: - from itertools import zip_longest -except ImportError: - from itertools import izip_longest as zip_longest +from django.utils.six.moves import zip_longest class SQLCompiler(compiler.SQLCompiler):