Commit fe4ef392 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Silence BytesWarning (backport 267a4d4d9d65).

parent bc27a050
...@@ -8,8 +8,8 @@ import weakref ...@@ -8,8 +8,8 @@ import weakref
import errno import errno
from test.support import (TESTFN, captured_output, check_impl_detail, from test.support import (TESTFN, captured_output, check_impl_detail,
cpython_only, gc_collect, run_unittest, no_tracing, check_warnings, cpython_only, gc_collect,
unlink) no_tracing, run_unittest, unlink)
class NaiveException(Exception): class NaiveException(Exception):
def __init__(self, x): def __init__(self, x):
...@@ -960,9 +960,10 @@ class ImportErrorTests(unittest.TestCase): ...@@ -960,9 +960,10 @@ class ImportErrorTests(unittest.TestCase):
def test_non_str_argument(self): def test_non_str_argument(self):
# Issue #15778 # Issue #15778
arg = b'abc' with check_warnings(('', BytesWarning), quiet=True):
exc = ImportError(arg) arg = b'abc'
self.assertEqual(str(arg), str(exc)) exc = ImportError(arg)
self.assertEqual(str(arg), str(exc))
def test_main(): def test_main():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment