Issue #15778: Coerce ImportError.args to a string when it isn't
already one.
Patch by Dave Malcolm.
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 0b1fd1b..55e9db3 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -937,6 +937,11 @@
self.assertEqual(exc.name, 'somename')
self.assertEqual(exc.path, 'somepath')
+ def test_non_str_argument(self):
+ # Issue #15778
+ arg = b'abc'
+ exc = ImportError(arg)
+ self.assertEqual(str(arg), str(exc))
def test_main():