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 import os
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,

View File

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

View File

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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from django.conf import settings from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage from django.contrib.flatpages.models import FlatPage

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,5 @@
"Thread-safe in-memory cache backend." "Thread-safe in-memory cache backend."
from __future__ import with_statement
import time import time
try: try:
import cPickle as pickle 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``). be executed through ``django-admin.py`` or ``manage.py``).
""" """
from __future__ import with_statement
import os import os
import sys 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 sys
import os import os
import gzip import gzip

View File

@ -1,4 +1,3 @@
from __future__ import with_statement
import cgi import cgi
import errno import errno
import mimetypes 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 Managed transactions don't do those commits, but will need some kind of manual
or implicit commits or rollbacks. or implicit commits or rollbacks.
""" """
from __future__ import with_statement
from functools import wraps from functools import wraps

View File

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

View File

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

View File

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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import warnings import warnings
from django.conf import settings, UserSettingsHolder from django.conf import settings, UserSettingsHolder
from django.core import mail 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
""" """
from __future__ import with_statement
import os import os
import shutil import shutil
import sys import sys

View File

@ -6,8 +6,6 @@ Synchronization primitives:
(Contributed to Django by eugene@lazutkin.com) (Contributed to Django by eugene@lazutkin.com)
""" """
from __future__ import with_statement
import contextlib import contextlib
try: try:
import threading import threading

View File

@ -2,7 +2,6 @@
Views and functions for serving static files. These are only to be used Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting. during development, and SHOULD NOT be used in a production setting.
""" """
from __future__ import with_statement
import mimetypes import mimetypes
import os 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.db.models import Max
from django.test import TestCase, skipUnlessDBFeature 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.conf import settings
from django.core.exceptions import ImproperlyConfigured 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 shutil
import tempfile 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 datetime import datetime
from operator import attrgetter 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 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 copy import deepcopy
from datetime import datetime 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 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 datetime
import os 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.contrib.contenttypes.models import ContentType
from django.test import TestCase 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 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 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 from __future__ import absolute_import
# and up it is no longer necessary.
from __future__ import with_statement, absolute_import
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from datetime import datetime from datetime import datetime

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import datetime import datetime
import os import os
import sys 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.db import connection, transaction, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature from django.test import TransactionTestCase, skipUnlessDBFeature

View File

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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.test import TestCase 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 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 import admin
from django.contrib.admin.options import IncorrectLookupParameters 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 advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE
and default settings.py files. and default settings.py files.
""" """
from __future__ import with_statement
import os import os
import re import re

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends. # Unit and doctests for specific database backends.
from __future__ import with_statement, absolute_import from __future__ import absolute_import
import datetime import datetime
import threading import threading

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from django.contrib import admin from django.contrib import admin
from django.utils.unittest import TestCase from django.utils.unittest import TestCase

View File

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

View File

@ -2,7 +2,7 @@
# Unit tests for cache framework # Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file. # 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 hashlib
import os 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 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.forms import CommentForm
from django.contrib.comments.models import Comment from django.contrib.comments.models import Comment

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.forms import * from django.forms import *
from django.test import TestCase from django.test import TestCase
from django.utils.translation import ugettext_lazy, override from django.utils.translation import ugettext_lazy, override

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import copy import copy
from django.conf import compat_patch_logging_config 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 from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger
# logging config prior to using filter with mail_admins # logging config prior to using filter with mail_admins
OLD_LOGGING = { OLD_LOGGING = {
'version': 1, '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 import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME 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 from datetime import date

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import time import time
import warnings import warnings
from datetime import datetime, timedelta 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 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 the serializers. This includes all valid data values, plus
forward, backwards and self references. forward, backwards and self references.
""" """
# This is necessary in Python 2.5 to enable the with statement, in 2.6 from __future__ import absolute_import
# and up it is no longer necessary.
from __future__ import with_statement, absolute_import
import datetime import datetime
import decimal import decimal

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import with_statement, absolute_import from __future__ import absolute_import
from django.forms import EmailField, IntegerField from django.forms import EmailField, IntegerField
from django.http import HttpResponse from django.http import HttpResponse

View File

@ -1,5 +1,4 @@
# coding: utf-8 # coding: utf-8
from __future__ import with_statement
from django.test import TestCase from django.test import TestCase
from django.utils.encoding import iri_to_uri 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 inspect
import os import os

View File

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

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application