diff --git a/rest_framework/compat.py b/rest_framework/compat.py index dcc8aaa6b..8c7617c12 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -17,7 +17,7 @@ except: # cStringIO only if it's available, otherwise StringIO try: - import cStringIO as StringIO + import cStringIO.StringIO as StringIO except ImportError: from six import StringIO diff --git a/rest_framework/tests/files.py b/rest_framework/tests/files.py index 027aecf76..e76097063 100644 --- a/rest_framework/tests/files.py +++ b/rest_framework/tests/files.py @@ -29,7 +29,7 @@ class FileSerializerTests(TestCase): def test_create(self): now = datetime.datetime.now() - file = StringIO.StringIO('stuff') + file = StringIO('stuff') file.name = 'stuff.txt' file.size = file.len serializer = UploadedFileSerializer(data={'created': now}, files={'file': file})