Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit b964317

Browse files
committed
New style io import for the tests file
1 parent a788b94 commit b964317

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
import string
1313
import textwrap
1414
import unittest
15-
import StringIO
15+
try:
16+
import io
17+
except ImportError:
18+
import cStringIO as io
1619
from copy import copy
1720
from documentcloud import DocumentCloud
1821
from documentcloud.toolbox import DoesNotExistError
@@ -435,7 +438,7 @@ def test_virtual_file_upload_and_delete(self):
435438
"""
436439
path = os.path.join(os.path.dirname(__file__), "español.pdf")
437440
real_file = open(path, 'rb')
438-
virtual_file = StringIO.StringIO(real_file.read())
441+
virtual_file = io.StringIO(real_file.read())
439442
obj = self.private_client.documents.upload(virtual_file, title='Espanola!')
440443
self.assertEqual(type(obj), Document)
441444
# Delete it

0 commit comments

Comments
 (0)