From 9383a2761c67d588378f3679cc6c8ea3651a73c8 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 30 Mar 2012 08:02:08 +0000 Subject: [PATCH] Removed with_statement imports, useless in Python >= 2.6. Refs #17965. Thanks jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/tests/forms.py | 1 - django/contrib/auth/tests/views.py | 1 - django/contrib/contenttypes/tests.py | 2 -- django/contrib/flatpages/tests/forms.py | 2 -- django/contrib/formtools/tests/wizard/wizardtests/tests.py | 1 - django/contrib/humanize/tests.py | 2 -- django/contrib/sessions/tests.py | 2 -- .../contrib/staticfiles/management/commands/collectstatic.py | 2 -- django/contrib/staticfiles/storage.py | 1 - django/core/cache/backends/locmem.py | 2 -- django/core/management/base.py | 1 - django/core/management/commands/loaddata.py | 4 ---- django/core/management/templates.py | 1 - django/db/transaction.py | 1 - django/templatetags/i18n.py | 1 - django/templatetags/tz.py | 2 -- django/test/testcases.py | 2 -- django/test/utils.py | 2 -- django/utils/archive.py | 1 - django/utils/synch.py | 4 +--- django/views/static.py | 1 - tests/modeltests/distinct_on_fields/tests.py | 2 +- tests/modeltests/empty/tests.py | 2 +- tests/modeltests/files/tests.py | 2 +- tests/modeltests/lookup/tests.py | 2 +- tests/modeltests/many_to_many/tests.py | 2 +- tests/modeltests/many_to_one/tests.py | 2 +- tests/modeltests/many_to_one_null/tests.py | 2 +- tests/modeltests/model_forms/tests.py | 2 +- tests/modeltests/prefetch_related/tests.py | 2 +- tests/modeltests/properties/tests.py | 2 +- tests/modeltests/select_related/tests.py | 2 +- tests/modeltests/serializers/tests.py | 4 +--- tests/modeltests/timezones/tests.py | 2 -- tests/modeltests/transactions/tests.py | 2 +- tests/modeltests/user_commands/tests.py | 2 -- tests/modeltests/validation/__init__.py | 2 -- tests/modeltests/validation/test_unique.py | 2 +- tests/regressiontests/admin_changelist/tests.py | 2 +- tests/regressiontests/admin_scripts/tests.py | 1 - tests/regressiontests/admin_views/tests.py | 2 +- tests/regressiontests/admin_widgets/tests.py | 2 +- tests/regressiontests/backends/tests.py | 2 +- tests/regressiontests/bug8245/tests.py | 4 +--- tests/regressiontests/bulk_create/tests.py | 2 +- tests/regressiontests/cache/tests.py | 2 +- tests/regressiontests/comment_tests/tests/model_tests.py | 2 +- .../regressiontests/comment_tests/tests/templatetag_tests.py | 2 +- tests/regressiontests/csrf_tests/tests.py | 1 - tests/regressiontests/defaultfilters/tests.py | 1 - tests/regressiontests/defer_regress/tests.py | 2 +- tests/regressiontests/forms/tests/models.py | 2 +- tests/regressiontests/forms/tests/regressions.py | 1 - tests/regressiontests/i18n/commands/compilation.py | 2 -- tests/regressiontests/i18n/commands/extraction.py | 1 - tests/regressiontests/i18n/contenttypes/tests.py | 1 - tests/regressiontests/i18n/patterns/tests.py | 2 -- tests/regressiontests/i18n/tests.py | 2 +- tests/regressiontests/logging_tests/tests.py | 3 --- tests/regressiontests/model_formsets_regress/tests.py | 2 +- tests/regressiontests/modeladmin/tests.py | 2 +- tests/regressiontests/requests/tests.py | 2 -- tests/regressiontests/select_related_onetoone/tests.py | 2 +- tests/regressiontests/serializers_regress/tests.py | 4 +--- tests/regressiontests/settings_tests/tests.py | 2 -- tests/regressiontests/staticfiles_tests/tests.py | 1 - tests/regressiontests/templates/response.py | 2 -- tests/regressiontests/templates/tests.py | 2 +- tests/regressiontests/test_utils/tests.py | 2 +- tests/regressiontests/text/tests.py | 1 - tests/regressiontests/views/tests/debug.py | 2 +- tests/regressiontests/views/tests/i18n.py | 2 +- tests/regressiontests/wsgi/tests.py | 2 -- 73 files changed, 35 insertions(+), 104 deletions(-) diff --git a/django/contrib/auth/tests/forms.py b/django/contrib/auth/tests/forms.py index 3c890d4c8a..27908282eb 100644 --- a/django/contrib/auth/tests/forms.py +++ b/django/contrib/auth/tests/forms.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os from django.contrib.auth.models import User from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py index 72440864da..37045cd898 100644 --- a/django/contrib/auth/tests/views.py +++ b/django/contrib/auth/tests/views.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os import re import urllib diff --git a/django/contrib/contenttypes/tests.py b/django/contrib/contenttypes/tests.py index 3b7906c812..0057dd535d 100644 --- a/django/contrib/contenttypes/tests.py +++ b/django/contrib/contenttypes/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import urllib from django.db import models diff --git a/django/contrib/flatpages/tests/forms.py b/django/contrib/flatpages/tests/forms.py index 12b47e84d6..884c40acc8 100644 --- a/django/contrib/flatpages/tests/forms.py +++ b/django/contrib/flatpages/tests/forms.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage diff --git a/django/contrib/formtools/tests/wizard/wizardtests/tests.py b/django/contrib/formtools/tests/wizard/wizardtests/tests.py index 2ef39dc7a3..24234e442f 100644 --- a/django/contrib/formtools/tests/wizard/wizardtests/tests.py +++ b/django/contrib/formtools/tests/wizard/wizardtests/tests.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import os from django import forms diff --git a/django/contrib/humanize/tests.py b/django/contrib/humanize/tests.py index f921b12778..2aa36443b1 100644 --- a/django/contrib/humanize/tests.py +++ b/django/contrib/humanize/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import datetime import new diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 7686bd254e..107a7bcd80 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from datetime import datetime, timedelta import shutil import string diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py index 850b0132fb..cab96c8d44 100644 --- a/django/contrib/staticfiles/management/commands/collectstatic.py +++ b/django/contrib/staticfiles/management/commands/collectstatic.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import sys from optparse import make_option diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py index c000f97d05..ea18497d53 100644 --- a/django/contrib/staticfiles/storage.py +++ b/django/contrib/staticfiles/storage.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import hashlib import os import posixpath diff --git a/django/core/cache/backends/locmem.py b/django/core/cache/backends/locmem.py index 6ba0c98945..9196b3b42b 100644 --- a/django/core/cache/backends/locmem.py +++ b/django/core/cache/backends/locmem.py @@ -1,7 +1,5 @@ "Thread-safe in-memory cache backend." -from __future__ import with_statement - import time try: import cPickle as pickle diff --git a/django/core/management/base.py b/django/core/management/base.py index a9fc38cfaa..0bd64f24b5 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -3,7 +3,6 @@ Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ -from __future__ import with_statement import os import sys diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index 0c234fb746..3e5b7584f3 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -1,7 +1,3 @@ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement - import sys import os import gzip diff --git a/django/core/management/templates.py b/django/core/management/templates.py index 9a4b2c1723..b2a1226dbc 100644 --- a/django/core/management/templates.py +++ b/django/core/management/templates.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import cgi import errno import mimetypes diff --git a/django/db/transaction.py b/django/db/transaction.py index 4ecd2d1f08..f3ce2b2335 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -11,7 +11,6 @@ called, a commit is made. Managed transactions don't do those commits, but will need some kind of manual or implicit commits or rollbacks. """ -from __future__ import with_statement from functools import wraps diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index dc3d93e90f..ca79f41edc 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -1,4 +1,3 @@ -from __future__ import with_statement import re from django.template import (Node, Variable, TemplateSyntaxError, diff --git a/django/templatetags/tz.py b/django/templatetags/tz.py index 48c511f2e0..ea35b75e77 100644 --- a/django/templatetags/tz.py +++ b/django/templatetags/tz.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from datetime import datetime, tzinfo try: diff --git a/django/test/testcases.py b/django/test/testcases.py index b5e1dc0418..c57099fc92 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import difflib import os import re diff --git a/django/test/utils.py b/django/test/utils.py index ed5ab590a7..805117df80 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import warnings from django.conf import settings, UserSettingsHolder from django.core import mail diff --git a/django/utils/archive.py b/django/utils/archive.py index 9c2d4ac01b..027acf788a 100644 --- a/django/utils/archive.py +++ b/django/utils/archive.py @@ -21,7 +21,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from __future__ import with_statement import os import shutil import sys diff --git a/django/utils/synch.py b/django/utils/synch.py index d6ae2f0a72..4859907ae2 100644 --- a/django/utils/synch.py +++ b/django/utils/synch.py @@ -6,8 +6,6 @@ Synchronization primitives: (Contributed to Django by eugene@lazutkin.com) """ -from __future__ import with_statement - import contextlib try: import threading @@ -92,4 +90,4 @@ class RWLock(object): try: yield finally: - self.writer_leaves() \ No newline at end of file + self.writer_leaves() diff --git a/django/views/static.py b/django/views/static.py index ed237793e4..2a756134a6 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -2,7 +2,6 @@ Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ -from __future__ import with_statement import mimetypes import os diff --git a/tests/modeltests/distinct_on_fields/tests.py b/tests/modeltests/distinct_on_fields/tests.py index 5021bc8088..4d827d15b6 100644 --- a/tests/modeltests/distinct_on_fields/tests.py +++ b/tests/modeltests/distinct_on_fields/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature diff --git a/tests/modeltests/empty/tests.py b/tests/modeltests/empty/tests.py index 255b80eb8f..db464c632d 100644 --- a/tests/modeltests/empty/tests.py +++ b/tests/modeltests/empty/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.conf import settings from django.core.exceptions import ImproperlyConfigured diff --git a/tests/modeltests/files/tests.py b/tests/modeltests/files/tests.py index 50017be359..3bfe193610 100644 --- a/tests/modeltests/files/tests.py +++ b/tests/modeltests/files/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import shutil import tempfile diff --git a/tests/modeltests/lookup/tests.py b/tests/modeltests/lookup/tests.py index 3571e216be..60ab25fc63 100644 --- a/tests/modeltests/lookup/tests.py +++ b/tests/modeltests/lookup/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from datetime import datetime from operator import attrgetter diff --git a/tests/modeltests/many_to_many/tests.py b/tests/modeltests/many_to_many/tests.py index 9fa524f993..44bdde3aeb 100644 --- a/tests/modeltests/many_to_many/tests.py +++ b/tests/modeltests/many_to_many/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/many_to_one/tests.py b/tests/modeltests/many_to_one/tests.py index d9d67bbb98..aed952fe2f 100644 --- a/tests/modeltests/many_to_one/tests.py +++ b/tests/modeltests/many_to_one/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from copy import deepcopy from datetime import datetime diff --git a/tests/modeltests/many_to_one_null/tests.py b/tests/modeltests/many_to_one_null/tests.py index 1e302ecada..1a404bde02 100644 --- a/tests/modeltests/many_to_one_null/tests.py +++ b/tests/modeltests/many_to_one_null/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/model_forms/tests.py b/tests/modeltests/model_forms/tests.py index ff5048eced..fe20d79a29 100644 --- a/tests/modeltests/model_forms/tests.py +++ b/tests/modeltests/model_forms/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import os diff --git a/tests/modeltests/prefetch_related/tests.py b/tests/modeltests/prefetch_related/tests.py index b0bc435941..135b5b8ad2 100644 --- a/tests/modeltests/prefetch_related/tests.py +++ b/tests/modeltests/prefetch_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib.contenttypes.models import ContentType from django.test import TestCase diff --git a/tests/modeltests/properties/tests.py b/tests/modeltests/properties/tests.py index f01b22a4bb..8a40d06e98 100644 --- a/tests/modeltests/properties/tests.py +++ b/tests/modeltests/properties/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/select_related/tests.py b/tests/modeltests/select_related/tests.py index 1b3715a1c8..ebe2f8c2be 100644 --- a/tests/modeltests/select_related/tests.py +++ b/tests/modeltests/select_related/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/modeltests/serializers/tests.py b/tests/modeltests/serializers/tests.py index 309a83e8b4..02538b0fb7 100644 --- a/tests/modeltests/serializers/tests.py +++ b/tests/modeltests/serializers/tests.py @@ -1,6 +1,4 @@ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import # -*- coding: utf-8 -*- from datetime import datetime diff --git a/tests/modeltests/timezones/tests.py b/tests/modeltests/timezones/tests.py index 171c2187f2..b1e22e1a55 100644 --- a/tests/modeltests/timezones/tests.py +++ b/tests/modeltests/timezones/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import datetime import os import sys diff --git a/tests/modeltests/transactions/tests.py b/tests/modeltests/transactions/tests.py index ed416e24b7..f3246eef2a 100644 --- a/tests/modeltests/transactions/tests.py +++ b/tests/modeltests/transactions/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.db import connection, transaction, IntegrityError from django.test import TransactionTestCase, skipUnlessDBFeature diff --git a/tests/modeltests/user_commands/tests.py b/tests/modeltests/user_commands/tests.py index e138e07b91..896dd667ff 100644 --- a/tests/modeltests/user_commands/tests.py +++ b/tests/modeltests/user_commands/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from StringIO import StringIO from django.core import management diff --git a/tests/modeltests/validation/__init__.py b/tests/modeltests/validation/__init__.py index 4a1ad3ab56..5daa06be66 100644 --- a/tests/modeltests/validation/__init__.py +++ b/tests/modeltests/validation/__init__.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.core.exceptions import ValidationError from django.test import TestCase diff --git a/tests/modeltests/validation/test_unique.py b/tests/modeltests/validation/test_unique.py index 3ae981d45c..497bb9d72d 100644 --- a/tests/modeltests/validation/test_unique.py +++ b/tests/modeltests/validation/test_unique.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime diff --git a/tests/regressiontests/admin_changelist/tests.py b/tests/regressiontests/admin_changelist/tests.py index d2b017b258..7e4546e5b3 100644 --- a/tests/regressiontests/admin_changelist/tests.py +++ b/tests/regressiontests/admin_changelist/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib import admin from django.contrib.admin.options import IncorrectLookupParameters diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 669c6e8258..dd3b0b4385 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -3,7 +3,6 @@ A series of tests to establish that the command-line managment tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ -from __future__ import with_statement import os import re diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 12f1c677af..b4718447d1 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -1,5 +1,5 @@ # coding: utf-8 -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import os import re diff --git a/tests/regressiontests/admin_widgets/tests.py b/tests/regressiontests/admin_widgets/tests.py index 87e0309ddc..ab6db4d1fb 100644 --- a/tests/regressiontests/admin_widgets/tests.py +++ b/tests/regressiontests/admin_widgets/tests.py @@ -1,5 +1,5 @@ # encoding: utf-8 -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from datetime import datetime diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index cfb662ee80..d5b1ea82bf 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Unit and doctests for specific database backends. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import threading diff --git a/tests/regressiontests/bug8245/tests.py b/tests/regressiontests/bug8245/tests.py index b756b84144..5da0b1f718 100644 --- a/tests/regressiontests/bug8245/tests.py +++ b/tests/regressiontests/bug8245/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.contrib import admin from django.utils.unittest import TestCase @@ -19,4 +17,4 @@ class Bug8245Test(TestCase): # the first time, not an AlreadyRegistered error. with self.assertRaises(Exception) as cm: admin.autodiscover() - self.assertEqual(str(cm.exception), "Bad admin module") \ No newline at end of file + self.assertEqual(str(cm.exception), "Bad admin module") diff --git a/tests/regressiontests/bulk_create/tests.py b/tests/regressiontests/bulk_create/tests.py index 0fa142b795..284ea9fdd9 100644 --- a/tests/regressiontests/bulk_create/tests.py +++ b/tests/regressiontests/bulk_create/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from operator import attrgetter diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index bd29cde533..6dbc03db32 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/cache/tests.py @@ -2,7 +2,7 @@ # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import hashlib import os diff --git a/tests/regressiontests/comment_tests/tests/model_tests.py b/tests/regressiontests/comment_tests/tests/model_tests.py index 11d96aea70..69c1a8118f 100644 --- a/tests/regressiontests/comment_tests/tests/model_tests.py +++ b/tests/regressiontests/comment_tests/tests/model_tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django.contrib.comments.models import Comment diff --git a/tests/regressiontests/comment_tests/tests/templatetag_tests.py b/tests/regressiontests/comment_tests/tests/templatetag_tests.py index 0b036ce921..62b3fb35db 100644 --- a/tests/regressiontests/comment_tests/tests/templatetag_tests.py +++ b/tests/regressiontests/comment_tests/tests/templatetag_tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py index 71400ead89..d403951ae2 100644 --- a/tests/regressiontests/csrf_tests/tests.py +++ b/tests/regressiontests/csrf_tests/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement from django.conf import settings from django.core.context_processors import csrf diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index 1660a75e9c..38e44d4869 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement import datetime import decimal diff --git a/tests/regressiontests/defer_regress/tests.py b/tests/regressiontests/defer_regress/tests.py index 4afe39bee2..c9baad6a1f 100644 --- a/tests/regressiontests/defer_regress/tests.py +++ b/tests/regressiontests/defer_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from operator import attrgetter diff --git a/tests/regressiontests/forms/tests/models.py b/tests/regressiontests/forms/tests/models.py index b5e2c3a885..64cd18bde6 100644 --- a/tests/regressiontests/forms/tests/models.py +++ b/tests/regressiontests/forms/tests/models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime diff --git a/tests/regressiontests/forms/tests/regressions.py b/tests/regressiontests/forms/tests/regressions.py index a93781da20..267ef300e6 100644 --- a/tests/regressiontests/forms/tests/regressions.py +++ b/tests/regressiontests/forms/tests/regressions.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement from django.forms import * from django.test import TestCase from django.utils.translation import ugettext_lazy, override diff --git a/tests/regressiontests/i18n/commands/compilation.py b/tests/regressiontests/i18n/commands/compilation.py index ee558b261b..1f38910b61 100644 --- a/tests/regressiontests/i18n/commands/compilation.py +++ b/tests/regressiontests/i18n/commands/compilation.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os try: from cStringIO import StringIO diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py index 4eb7abc7f0..fb9ca4ed08 100644 --- a/tests/regressiontests/i18n/commands/extraction.py +++ b/tests/regressiontests/i18n/commands/extraction.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement import os import re diff --git a/tests/regressiontests/i18n/contenttypes/tests.py b/tests/regressiontests/i18n/contenttypes/tests.py index 79928d9e4f..a44895f0cc 100644 --- a/tests/regressiontests/i18n/contenttypes/tests.py +++ b/tests/regressiontests/i18n/contenttypes/tests.py @@ -1,5 +1,4 @@ # coding: utf-8 -from __future__ import with_statement import os diff --git a/tests/regressiontests/i18n/patterns/tests.py b/tests/regressiontests/i18n/patterns/tests.py index 16fbec014a..df7beac239 100644 --- a/tests/regressiontests/i18n/patterns/tests.py +++ b/tests/regressiontests/i18n/patterns/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import warnings diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 99a55bd24d..f0b4a61abb 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import decimal diff --git a/tests/regressiontests/logging_tests/tests.py b/tests/regressiontests/logging_tests/tests.py index 4e29e25d99..5563ea6b4f 100644 --- a/tests/regressiontests/logging_tests/tests.py +++ b/tests/regressiontests/logging_tests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import copy from django.conf import compat_patch_logging_config @@ -9,7 +7,6 @@ from django.test.utils import override_settings from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger - # logging config prior to using filter with mail_admins OLD_LOGGING = { 'version': 1, diff --git a/tests/regressiontests/model_formsets_regress/tests.py b/tests/regressiontests/model_formsets_regress/tests.py index d058f1d8bc..f1e935e2ea 100644 --- a/tests/regressiontests/model_formsets_regress/tests.py +++ b/tests/regressiontests/model_formsets_regress/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from django import forms from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME diff --git a/tests/regressiontests/modeladmin/tests.py b/tests/regressiontests/modeladmin/tests.py index f9dec69ae8..04b02eb36b 100644 --- a/tests/regressiontests/modeladmin/tests.py +++ b/tests/regressiontests/modeladmin/tests.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, with_statement +from __future__ import absolute_import from datetime import date diff --git a/tests/regressiontests/requests/tests.py b/tests/regressiontests/requests/tests.py index b7a4788ec5..f986046b5d 100644 --- a/tests/regressiontests/requests/tests.py +++ b/tests/regressiontests/requests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import time import warnings from datetime import datetime, timedelta diff --git a/tests/regressiontests/select_related_onetoone/tests.py b/tests/regressiontests/select_related_onetoone/tests.py index 643a0ffc40..d57ee90570 100644 --- a/tests/regressiontests/select_related_onetoone/tests.py +++ b/tests/regressiontests/select_related_onetoone/tests.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.test import TestCase diff --git a/tests/regressiontests/serializers_regress/tests.py b/tests/regressiontests/serializers_regress/tests.py index 65194da428..289db05c71 100644 --- a/tests/regressiontests/serializers_regress/tests.py +++ b/tests/regressiontests/serializers_regress/tests.py @@ -6,9 +6,7 @@ test case that is capable of testing the capabilities of the serializers. This includes all valid data values, plus forward, backwards and self references. """ -# This is necessary in Python 2.5 to enable the with statement, in 2.6 -# and up it is no longer necessary. -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import datetime import decimal diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py index a2e6c490b4..47e5b08952 100644 --- a/tests/regressiontests/settings_tests/tests.py +++ b/tests/regressiontests/settings_tests/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os from django.conf import settings, global_settings diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py index 733c3cc845..7639161fc0 100644 --- a/tests/regressiontests/staticfiles_tests/tests.py +++ b/tests/regressiontests/staticfiles_tests/tests.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import with_statement import codecs import os diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py index 5feb8cc51b..7c59da2b32 100644 --- a/tests/regressiontests/templates/response.py +++ b/tests/regressiontests/templates/response.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - import os import pickle import time diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index f74aa757e6..e166f7e15b 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.conf import settings diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py index 7f4208c0e1..3afce90a56 100644 --- a/tests/regressiontests/test_utils/tests.py +++ b/tests/regressiontests/test_utils/tests.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import from django.forms import EmailField, IntegerField from django.http import HttpResponse diff --git a/tests/regressiontests/text/tests.py b/tests/regressiontests/text/tests.py index 2bbd8efe37..e4c4c00938 100644 --- a/tests/regressiontests/text/tests.py +++ b/tests/regressiontests/text/tests.py @@ -1,5 +1,4 @@ # coding: utf-8 -from __future__ import with_statement from django.test import TestCase from django.utils.encoding import iri_to_uri diff --git a/tests/regressiontests/views/tests/debug.py b/tests/regressiontests/views/tests/debug.py index c6f248a8b8..2be33c47e8 100644 --- a/tests/regressiontests/views/tests/debug.py +++ b/tests/regressiontests/views/tests/debug.py @@ -1,4 +1,4 @@ -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import inspect import os diff --git a/tests/regressiontests/views/tests/i18n.py b/tests/regressiontests/views/tests/i18n.py index 877cf964dd..9993ae959c 100644 --- a/tests/regressiontests/views/tests/i18n.py +++ b/tests/regressiontests/views/tests/i18n.py @@ -1,5 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import with_statement, absolute_import +from __future__ import absolute_import import gettext from os import path diff --git a/tests/regressiontests/wsgi/tests.py b/tests/regressiontests/wsgi/tests.py index 9da2adce54..0e8d7f2ada 100644 --- a/tests/regressiontests/wsgi/tests.py +++ b/tests/regressiontests/wsgi/tests.py @@ -1,5 +1,3 @@ -from __future__ import with_statement - from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application from django.core.wsgi import get_wsgi_application