summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testutil.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/testutil.py b/tests/testutil.py
index e02ea70..89feb3c 100644
--- a/tests/testutil.py
+++ b/tests/testutil.py
@@ -7,13 +7,17 @@ import io
import logging
import os
import os.path
+import sys
import tempfile
import unittest
class LoggingTestCase(unittest.TestCase):
def setUp(self):
- self.log = io.StringIO()
+ if sys.version_info < (3,):
+ self.log = io.BytesIO()
+ else:
+ self.log = io.StringIO()
self.log_handler = logging.getLogger().addHandler(
logging.StreamHandler(self.log))