Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 9383a2761c67d588378f3679cc6c8ea3651a73c8 1 parent 8bb5b60
@claudep claudep authored
Showing with 35 additions and 104 deletions.
  1. +0 −1  django/contrib/auth/tests/forms.py
  2. +0 −1  django/contrib/auth/tests/views.py
  3. +0 −2  django/contrib/contenttypes/tests.py
  4. +0 −2  django/contrib/flatpages/tests/forms.py
  5. +0 −1  django/contrib/formtools/tests/wizard/wizardtests/tests.py
  6. +0 −2  django/contrib/humanize/tests.py
  7. +0 −2  django/contrib/sessions/tests.py
  8. +0 −2  django/contrib/staticfiles/management/commands/collectstatic.py
  9. +0 −1  django/contrib/staticfiles/storage.py
  10. +0 −2  django/core/cache/backends/locmem.py
  11. +0 −1  django/core/management/base.py
  12. +0 −4 django/core/management/commands/loaddata.py
  13. +0 −1  django/core/management/templates.py
  14. +0 −1  django/db/transaction.py
  15. +0 −1  django/templatetags/i18n.py
  16. +0 −2  django/templatetags/tz.py
  17. +0 −2  django/test/testcases.py
  18. +0 −2  django/test/utils.py
  19. +0 −1  django/utils/archive.py
  20. +1 −3 django/utils/synch.py
  21. +0 −1  django/views/static.py
  22. +1 −1  tests/modeltests/distinct_on_fields/tests.py
  23. +1 −1  tests/modeltests/empty/tests.py
  24. +1 −1  tests/modeltests/files/tests.py
  25. +1 −1  tests/modeltests/lookup/tests.py
  26. +1 −1  tests/modeltests/many_to_many/tests.py
  27. +1 −1  tests/modeltests/many_to_one/tests.py
  28. +1 −1  tests/modeltests/many_to_one_null/tests.py
  29. +1 −1  tests/modeltests/model_forms/tests.py
  30. +1 −1  tests/modeltests/prefetch_related/tests.py
  31. +1 −1  tests/modeltests/properties/tests.py
  32. +1 −1  tests/modeltests/select_related/tests.py
  33. +1 −3 tests/modeltests/serializers/tests.py
  34. +0 −2  tests/modeltests/timezones/tests.py
  35. +1 −1  tests/modeltests/transactions/tests.py
  36. +0 −2  tests/modeltests/user_commands/tests.py
  37. +0 −2  tests/modeltests/validation/__init__.py
  38. +1 −1  tests/modeltests/validation/test_unique.py
  39. +1 −1  tests/regressiontests/admin_changelist/tests.py
  40. +0 −1  tests/regressiontests/admin_scripts/tests.py
  41. +1 −1  tests/regressiontests/admin_views/tests.py
  42. +1 −1  tests/regressiontests/admin_widgets/tests.py
  43. +1 −1  tests/regressiontests/backends/tests.py
  44. +1 −3 tests/regressiontests/bug8245/tests.py
  45. +1 −1  tests/regressiontests/bulk_create/tests.py
  46. +1 −1  tests/regressiontests/cache/tests.py
  47. +1 −1  tests/regressiontests/comment_tests/tests/model_tests.py
  48. +1 −1  tests/regressiontests/comment_tests/tests/templatetag_tests.py
  49. +0 −1  tests/regressiontests/csrf_tests/tests.py
  50. +0 −1  tests/regressiontests/defaultfilters/tests.py
  51. +1 −1  tests/regressiontests/defer_regress/tests.py
  52. +1 −1  tests/regressiontests/forms/tests/models.py
  53. +0 −1  tests/regressiontests/forms/tests/regressions.py
  54. +0 −2  tests/regressiontests/i18n/commands/compilation.py
  55. +0 −1  tests/regressiontests/i18n/commands/extraction.py
  56. +0 −1  tests/regressiontests/i18n/contenttypes/tests.py
  57. +0 −2  tests/regressiontests/i18n/patterns/tests.py
  58. +1 −1  tests/regressiontests/i18n/tests.py
  59. +0 −3  tests/regressiontests/logging_tests/tests.py
  60. +1 −1  tests/regressiontests/model_formsets_regress/tests.py
  61. +1 −1  tests/regressiontests/modeladmin/tests.py
  62. +0 −2  tests/regressiontests/requests/tests.py
  63. +1 −1  tests/regressiontests/select_related_onetoone/tests.py
  64. +1 −3 tests/regressiontests/serializers_regress/tests.py
  65. +0 −2  tests/regressiontests/settings_tests/tests.py
  66. +0 −1  tests/regressiontests/staticfiles_tests/tests.py
  67. +0 −2  tests/regressiontests/templates/response.py
  68. +1 −1  tests/regressiontests/templates/tests.py
  69. +1 −1  tests/regressiontests/test_utils/tests.py
  70. +0 −1  tests/regressiontests/text/tests.py
  71. +1 −1  tests/regressiontests/views/tests/debug.py
  72. +1 −1  tests/regressiontests/views/tests/i18n.py
  73. +0 −2  tests/regressiontests/wsgi/tests.py
View
1  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,
View
1  django/contrib/auth/tests/views.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import os
import re
import urllib
View
2  django/contrib/contenttypes/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import urllib
from django.db import models
View
2  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
View
1  django/contrib/formtools/tests/wizard/wizardtests/tests.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import os
from django import forms
View
2  django/contrib/humanize/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import datetime
import new
View
2  django/contrib/sessions/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
from datetime import datetime, timedelta
import shutil
import string
View
2  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
View
1  django/contrib/staticfiles/storage.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import hashlib
import os
import posixpath
View
2  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
View
1  django/core/management/base.py
@@ -3,7 +3,6 @@
be executed through ``django-admin.py`` or ``manage.py``).
"""
-from __future__ import with_statement
import os
import sys
View
4 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
View
1  django/core/management/templates.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import cgi
import errno
import mimetypes
View
1  django/db/transaction.py
@@ -11,7 +11,6 @@
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
1  django/templatetags/i18n.py
@@ -1,4 +1,3 @@
-from __future__ import with_statement
import re
from django.template import (Node, Variable, TemplateSyntaxError,
View
2  django/templatetags/tz.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
from datetime import datetime, tzinfo
try:
View
2  django/test/testcases.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import difflib
import os
import re
View
2  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
View
1  django/utils/archive.py
@@ -21,7 +21,6 @@
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
4 django/utils/synch.py
@@ -6,8 +6,6 @@
(Contributed to Django by eugene@lazutkin.com)
"""
-from __future__ import with_statement
-
import contextlib
try:
import threading
@@ -92,4 +90,4 @@ def writer(self):
try:
yield
finally:
- self.writer_leaves()
+ self.writer_leaves()
View
1  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
2  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
View
4 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
View
2  tests/modeltests/timezones/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import datetime
import os
import sys
View
2  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
View
2  tests/modeltests/user_commands/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
from StringIO import StringIO
from django.core import management
View
2  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
View
2  tests/modeltests/validation/test_unique.py
@@ -1,4 +1,4 @@
-from __future__ import with_statement, absolute_import
+from __future__ import absolute_import
import datetime
View
2  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
View
1  tests/regressiontests/admin_scripts/tests.py
@@ -3,7 +3,6 @@
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
2  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
View
2  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
View
2  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
View
4 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 @@ def test_bug_8245(self):
# 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
2  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
View
2  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
View
2  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
View
2  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
View
1  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
View
1  tests/regressiontests/defaultfilters/tests.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-from __future__ import with_statement
import datetime
import decimal
View
2  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
View
2  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
View
1  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
View
2  tests/regressiontests/i18n/commands/compilation.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import os
try:
from cStringIO import StringIO
View
1  tests/regressiontests/i18n/commands/extraction.py
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
-from __future__ import with_statement
import os
import re
View
1  tests/regressiontests/i18n/contenttypes/tests.py
@@ -1,5 +1,4 @@
# coding: utf-8
-from __future__ import with_statement
import os
View
2  tests/regressiontests/i18n/patterns/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import os
import warnings
View
2  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
View
3  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.utils.log import CallbackFilter, RequireDebugFalse, getLogger
-
# logging config prior to using filter with mail_admins
OLD_LOGGING = {
'version': 1,
View
2  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
View
2  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
View
2  tests/regressiontests/requests/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import time
import warnings
from datetime import datetime, timedelta
View
2  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
View
4 tests/regressiontests/serializers_regress/tests.py
@@ -6,9 +6,7 @@
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
2  tests/regressiontests/settings_tests/tests.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import os
from django.conf import settings, global_settings
View
1  tests/regressiontests/staticfiles_tests/tests.py
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
-from __future__ import with_statement
import codecs
import os
View
2  tests/regressiontests/templates/response.py
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
import os
import pickle
import time
View
2  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
View
2  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
View
1  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
View
2  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
View
2  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
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.