Mercurial > python-hglib
diff tests/test-import.py @ 145:f3c430afa598
hglib: abstract out use of cStringIO.StringIO (issue4520)
The cStringIO module does not exist in Python 3, but io.BytesIO does.
This change prepares for the use of io.BytesIO when available by
replacing all uses of cStringIO.StringIO with an object named BytesIO.
author | Brett Cannon <brett@python.org> |
---|---|
date | Fri, 13 Mar 2015 11:31:54 -0400 |
parents | 4359cabcb0cc |
children | 8d7bf729a4db |
line wrap: on
line diff
--- a/tests/test-import.py Wed Mar 11 14:53:36 2015 -0500 +++ b/tests/test-import.py Fri Mar 13 11:31:54 2015 -0400 @@ -1,4 +1,5 @@ -import common, cStringIO, os +import common, os +from cStringIO import StringIO as BytesIO import hglib from hglib.util import b @@ -19,7 +20,7 @@ class test_import(common.basetest): def test_basic_cstringio(self): - self.client.import_(cStringIO.StringIO(patch)) + self.client.import_(BytesIO(patch)) self.assertEquals(self.client.cat([b('a')]), b('1\n')) def test_basic_file(self):