Skip to content

Commit 8794782

Browse files
committed
Fix 'io_utils' test 'test_with_encoding_utf8'
Ref.: #120
1 parent 0b981e5 commit 8794782

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_libs_io_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import pathlib
3+
import sys
34
import tempfile
45
import unittest
56

@@ -69,8 +70,11 @@ def test_with_encoding_utf8(self):
6970

7071
with tempfile.SpooledTemporaryFile(mode='rt', encoding='utf-8') as f:
7172
self.assertTrue(isinstance(f, tempfile.SpooledTemporaryFile))
72-
# note: this is a strange case.
73-
self.assertFalse(with_encoding_utf8(f))
73+
if sys.version_info > (3, 7):
74+
self.assertTrue(with_encoding_utf8(f))
75+
else:
76+
# note: this is a strange case (Python 3.7).
77+
self.assertFalse(with_encoding_utf8(f))
7478

7579
# Text mode - encoding 'latin1'
7680

0 commit comments

Comments
 (0)