mirror of https://github.com/django/django.git
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:
parent
8bb5b60628
commit
9383a2761c
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import urllib
|
||||
|
||||
from django.db import models
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
import os
|
||||
|
||||
from django import forms
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import datetime
|
||||
import new
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
import shutil
|
||||
import string
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import sys
|
||||
from optparse import make_option
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
import hashlib
|
||||
import os
|
||||
import posixpath
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"Thread-safe in-memory cache backend."
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import time
|
||||
try:
|
||||
import cPickle as pickle
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
import cgi
|
||||
import errno
|
||||
import mimetypes
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
import re
|
||||
|
||||
from django.template import (Node, Variable, TemplateSyntaxError,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
from datetime import datetime, tzinfo
|
||||
|
||||
try:
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import difflib
|
||||
import os
|
||||
import re
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import warnings
|
||||
from django.conf import settings, UserSettingsHolder
|
||||
from django.core import mail
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import shutil
|
||||
import tempfile
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import, with_statement
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import datetime
|
||||
from operator import attrgetter
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import, with_statement
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import, with_statement
|
||||
from __future__ import absolute_import
|
||||
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
import os
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
from StringIO import StringIO
|
||||
|
||||
from django.core import management
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# coding: utf-8
|
||||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import re
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# encoding: utf-8
|
||||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import, with_statement
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib.comments.models import Comment
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.context_processors import csrf
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
|
||||
import datetime
|
||||
import decimal
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import re
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# coding: utf-8
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import warnings
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
import decimal
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import, with_statement
|
||||
from __future__ import absolute_import
|
||||
|
||||
from datetime import date
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import time
|
||||
import warnings
|
||||
from datetime import datetime, timedelta
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
|
||||
from django.conf import settings, global_settings
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
|
||||
import codecs
|
||||
import os
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import pickle
|
||||
import time
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import with_statement, absolute_import
|
||||
from __future__ import absolute_import
|
||||
|
||||
import inspect
|
||||
import os
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue