gh-108494: Argument Clinic: fix support of Limited C API (GH-108536)

This commit is contained in:
Serhiy Storchaka 2023-08-28 16:04:27 +03:00 committed by GitHub
parent d90973340b
commit bc5356bb5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 147 additions and 114 deletions

View file

@ -281,12 +281,10 @@ class NamespaceSeparatorTest(unittest.TestCase):
expat.ParserCreate(namespace_separator=' ')
def test_illegal(self):
try:
with self.assertRaisesRegex(TypeError,
r"ParserCreate\(\) argument (2|'namespace_separator') "
r"must be str or None, not int"):
expat.ParserCreate(namespace_separator=42)
self.fail()
except TypeError as e:
self.assertEqual(str(e),
"ParserCreate() argument 'namespace_separator' must be str or None, not int")
try:
expat.ParserCreate(namespace_separator='too long')