diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-27 15:54:54 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-27 15:54:54 +0200 |
commit | 9f5e84d4917b29fe6d7668f4742da8769b4ff515 (patch) | |
tree | 0b7796c83f8d3e811e8cf619a5ea219d9ba0224e /tests/testutil.py | |
parent | 02d632e75a20c5c2540d4dc703289581f60047f4 (diff) | |
download | gemato-9f5e84d4917b29fe6d7668f4742da8769b4ff515.tar.gz |
testutil: Fix logger warnings for py2
Diffstat (limited to 'tests/testutil.py')
-rw-r--r-- | tests/testutil.py | 6 |
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)) |