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

@ -2799,11 +2799,13 @@ class TestSpecial(unittest.TestCase):
class ThirdFailedStrEnum(CustomStrEnum):
one = '1'
two = 2 # this will become '2'
with self.assertRaisesRegex(TypeError, '.encoding. must be str, not '):
with self.assertRaisesRegex(TypeError,
r"argument (2|'encoding') must be str, not "):
class ThirdFailedStrEnum(CustomStrEnum):
one = '1'
two = b'2', sys.getdefaultencoding
with self.assertRaisesRegex(TypeError, '.errors. must be str, not '):
with self.assertRaisesRegex(TypeError,
r"argument (3|'errors') must be str, not "):
class ThirdFailedStrEnum(CustomStrEnum):
one = '1'
two = b'2', 'ascii', 9