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
This commit is contained in:
Claude Paroz 2012-03-30 08:02:08 +00:00
parent 8bb5b60628
commit 9383a2761c
73 changed files with 35 additions and 104 deletions

View File

@ -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,

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import os
import re
import urllib

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import urllib
from django.db import models

View File

@ -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

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import os
from django import forms

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import datetime
import new

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from datetime import datetime, timedelta
import shutil
import string

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import os
import sys
from optparse import make_option

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import hashlib
import os
import posixpath

View File

@ -1,7 +1,5 @@
"Thread-safe in-memory cache backend."
from __future__ import with_statement
import time
try:
import cPickle as pickle

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import cgi
import errno
import mimetypes

View File

@ -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

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import re
from django.template import (Node, Variable, TemplateSyntaxError,

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from datetime import datetime, tzinfo
try:

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import difflib
import os
import re

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import warnings
from django.conf import settings, UserSettingsHolder
from django.core import mail

View File

@ -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

View File

@ -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()
self.writer_leaves()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import shutil
import tempfile

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import, with_statement
from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import, with_statement
from __future__ import absolute_import
from django.test import TestCase

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import, with_statement
from __future__ import absolute_import
from copy import deepcopy
from datetime import datetime

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from django.test import TestCase

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import datetime
import os

View File

@ -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

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from django.test import TestCase

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from django.test import TestCase

View File

@ -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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import datetime
import os
import sys

View File

@ -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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from StringIO import StringIO
from django.core import management

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from django.core.exceptions import ValidationError
from django.test import TestCase

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import datetime

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
# coding: utf-8
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import os
import re

View File

@ -1,5 +1,5 @@
# encoding: utf-8
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from datetime import datetime

View File

@ -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

View File

@ -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")
self.assertEqual(str(cm.exception), "Bad admin module")

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from operator import attrgetter

View File

@ -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

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import, with_statement
from __future__ import absolute_import
from django.contrib.comments.models import Comment

View File

@ -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

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import with_statement
from django.conf import settings
from django.core.context_processors import csrf

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import with_statement
import datetime
import decimal

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from operator import attrgetter

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import datetime

View File

@ -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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import os
try:
from cStringIO import StringIO

View File

@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
from __future__ import with_statement
import os
import re

View File

@ -1,5 +1,4 @@
# coding: utf-8
from __future__ import with_statement
import os

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import os
import warnings

View File

@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import datetime
import decimal

View File

@ -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,

View File

@ -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

View File

@ -1,4 +1,4 @@
from __future__ import absolute_import, with_statement
from __future__ import absolute_import
from datetime import date

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import time
import warnings
from datetime import datetime, timedelta

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from django.test import TestCase

View File

@ -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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import os
from django.conf import settings, global_settings

View File

@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
from __future__ import with_statement
import codecs
import os

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import os
import pickle
import time

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
from django.conf import settings

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
from __future__ import with_statement, absolute_import
from __future__ import absolute_import
import inspect
import os

View File

@ -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

View File

@ -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