diff options
author | Victor Stinner <vstinner@python.org> | 2024-03-15 07:49:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 07:49:58 (GMT) |
commit | 8fc8fbb43a8bb46c04ab55f96049039de243afb0 (patch) | |
tree | 17e90d405c7409abaad099fef4b3b7f0b8b4e7d6 /Tools | |
parent | 41e844a4acbd5070f675e034e31c988b4849dec9 (diff) | |
download | cpython-8fc8fbb43a8bb46c04ab55f96049039de243afb0.zip cpython-8fc8fbb43a8bb46c04ab55f96049039de243afb0.tar.gz cpython-8fc8fbb43a8bb46c04ab55f96049039de243afb0.tar.bz2 |
gh-85283: Build pwd extension with the limited C API (#116841)
Argument Clinic now uses the PEP 737 "%T" format to format type name
for the limited C API.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/clinic/libclinic/converter.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Tools/clinic/libclinic/converter.py b/Tools/clinic/libclinic/converter.py index da28ba5..744d03c 100644 --- a/Tools/clinic/libclinic/converter.py +++ b/Tools/clinic/libclinic/converter.py @@ -426,13 +426,12 @@ class CConverter(metaclass=CConverterAutoRegister): if limited_capi: if expected_literal: return (f'PyErr_Format(PyExc_TypeError, ' - f'"{{{{name}}}}() {displayname} must be {expected}, not %.50s", ' - f'{{argname}} == Py_None ? "None" : Py_TYPE({{argname}})->tp_name);') + f'"{{{{name}}}}() {displayname} must be {expected}, not %T", ' + f'{{argname}});') else: return (f'PyErr_Format(PyExc_TypeError, ' - f'"{{{{name}}}}() {displayname} must be %.50s, not %.50s", ' - f'"{expected}", ' - f'{{argname}} == Py_None ? "None" : Py_TYPE({{argname}})->tp_name);') + f'"{{{{name}}}}() {displayname} must be %s, not %T", ' + f'"{expected}", {{argname}});') else: if expected_literal: expected = f'"{expected}"' |