diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index d7644e8ef45..b77d1d79a1e 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -282,7 +282,7 @@ def test_null_bytes(self): with self.subTest(attr=attr): with self.assertRaises(ValueError) as cm: getattr(self.pathmodule, attr)('/tmp\x00abcds') - self.assertEqual(str(cm.exception), 'embedded null byte') + self.assertIn('embedded null', str(cm.exception)) # Following TestCase is not supposed to be run from test_genericpath. # It is inherited by other test modules (macpath, ntpath, posixpath).