Skip to content

Commit ca07fda

Browse files
committed
[py3] Switched to Python 3-compatible imports.
xrange/range will be dealt with in a separate commit due to the huge number of changes.
1 parent 0d914d0 commit ca07fda

File tree

24 files changed

+54
-48
lines changed

24 files changed

+54
-48
lines changed

django/contrib/auth/tests/basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django.test import TestCase
2-
from django.utils.unittest import skipUnless
31
from django.contrib.auth.models import User, AnonymousUser
42
from django.core.management import call_command
5-
from StringIO import StringIO
3+
from django.test import TestCase
4+
from django.utils.six import StringIO
5+
from django.utils.unittest import skipUnless
66

77
try:
88
import crypt as crypt_module

django/contrib/auth/tests/management.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import unicode_literals
22

3-
from StringIO import StringIO
4-
53
from django.contrib.auth import models, management
64
from django.contrib.auth.management.commands import changepassword
75
from django.core.management.base import CommandError
86
from django.test import TestCase
7+
from django.utils.six import StringIO
98

109

1110
class GetDefaultUsernameTestCase(TestCase):

django/contrib/gis/db/models/sql/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from future_builtins import zip
1+
from django.utils.six.moves import zip
22

33
from django.db.backends.util import truncate_name, typecast_timestamp
44
from django.db.models.sql import compiler

django/contrib/gis/gdal/tests/test_geom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from binascii import b2a_hex
22
try:
3-
import cPickle as pickle
3+
from django.utils.six.moves import cPickle as pickle
44
except ImportError:
55
import pickle
66

django/contrib/gis/geos/tests/test_geos.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,8 @@ def test_extent(self):
952952
def test_pickle(self):
953953
"Testing pickling and unpickling support."
954954
# Using both pickle and cPickle -- just 'cause.
955-
import pickle, cPickle
955+
from django.utils.six.moves import cPickle
956+
import pickle
956957

957958
# Creating a list of test geometries for pickling,
958959
# and setting the SRID on some of them.

django/contrib/gis/utils/ogrinspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Author: Travis Pinney, Dane Springmeyer, & Justin Bronn
77
"""
8-
from future_builtins import zip
8+
from django.utils.six.moves import zip
99
# Requires GDAL to use.
1010
from django.contrib.gis.gdal import DataSource
1111
from django.contrib.gis.gdal.field import OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime

django/contrib/sessions/backends/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
from datetime import datetime, timedelta
44
try:
5-
import cPickle as pickle
5+
from django.utils.six.moves import cPickle as pickle
66
except ImportError:
77
import pickle
88

django/contrib/sessions/backends/signed_cookies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try:
2-
import cPickle as pickle
2+
from django.utils.six.moves import cPickle as pickle
33
except ImportError:
44
import pickle
55

django/core/cache/backends/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from datetime import datetime
55

66
try:
7-
import cPickle as pickle
7+
from django.utils.six.moves import cPickle as pickle
88
except ImportError:
99
import pickle
1010

django/core/cache/backends/filebased.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import shutil
66
import time
77
try:
8-
import cPickle as pickle
8+
from django.utils.six.moves import cPickle as pickle
99
except ImportError:
1010
import pickle
1111

0 commit comments

Comments
 (0)