diff options
| author | Matthieu Huin <mhuin@redhat.com> | 2021-06-15 12:11:20 +0200 |
|---|---|---|
| committer | Matthieu Huin <mhuin@redhat.com> | 2021-06-15 12:11:20 +0200 |
| commit | c1a899ae21323c2f913c640f4688ae18de7aa40a (patch) | |
| tree | 135a6c1b6609f0d67549ce6dcd19d92842cfc802 /python/subunit/tests/test_subunit_stats.py | |
| parent | 1dafb884e47f5fc26232672b01c2a9574577e7be (diff) | |
| download | subunit-git-c1a899ae21323c2f913c640f4688ae18de7aa40a.tar.gz | |
Fix imports from testtools.compat
The future release of testtools will drop StringIO and BytesIO.
Try to import them from testtools.compat, or from the io module
if they're not available.
Diffstat (limited to 'python/subunit/tests/test_subunit_stats.py')
| -rw-r--r-- | python/subunit/tests/test_subunit_stats.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/subunit/tests/test_subunit_stats.py b/python/subunit/tests/test_subunit_stats.py index 7c5e42d..9faf24d 100644 --- a/python/subunit/tests/test_subunit_stats.py +++ b/python/subunit/tests/test_subunit_stats.py @@ -18,7 +18,11 @@ import unittest -from testtools.compat import _b, BytesIO, StringIO +from testtools.compat import _b +try: + from testtools.compat import BytesIO, StringIO +except ImportError: + from io import BytesIO, StringIO import subunit |
