File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88# -----------------------------------------------------------------------------
99
1010import os
11+ import sys
1112from unittest import TestCase , main
1213import tempfile
1314
1415import h5py
15- from io import StringIO , BytesIO
16+ if sys .version_info [0 ] == 2 :
17+ from StringIO import StringIO
18+ else :
19+ from io import StringIO
20+ from io import BytesIO
1621
1722from qiita_files .util import (open_file , _is_string_or_bytes )
1823
@@ -25,7 +30,7 @@ class TestFilePathOpening(TestCase):
2530 """Tests adapted from scikit-bio's skbio.io.util tests"""
2631 def test_is_string_or_bytes (self ):
2732 self .assertTrue (_is_string_or_bytes ('foo' ))
28- self .assertTrue (_is_string_or_bytes (u'foo' ))
33+ self .assertTrue (_is_string_or_bytes (u'foo' . encode ( "utf-8" ) ))
2934 self .assertTrue (_is_string_or_bytes (b'foo' ))
3035 self .assertFalse (_is_string_or_bytes (StringIO ('bar' )))
3136 self .assertFalse (_is_string_or_bytes ([1 ]))
You can’t perform that action at this time.
0 commit comments