mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
Since Python 3.12, PyUnicode_READY() does nothing and always returns 0. Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).
This commit is contained in:
parent
146939306a
commit
cbb9ba844f
35 changed files with 37 additions and 321 deletions
|
|
@ -3266,9 +3266,6 @@ class int_converter(CConverter):
|
|||
_PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname});
|
||||
goto exit;
|
||||
}}}}
|
||||
if (PyUnicode_READY({argname})) {{{{
|
||||
goto exit;
|
||||
}}}}
|
||||
if (PyUnicode_GET_LENGTH({argname}) != 1) {{{{
|
||||
_PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname});
|
||||
goto exit;
|
||||
|
|
@ -3730,9 +3727,6 @@ class unicode_converter(CConverter):
|
|||
_PyArg_BadArgument("{{name}}", {displayname}, "str", {argname});
|
||||
goto exit;
|
||||
}}}}
|
||||
if (PyUnicode_READY({argname}) == -1) {{{{
|
||||
goto exit;
|
||||
}}}}
|
||||
{paramname} = {argname};
|
||||
""".format(argname=argname, paramname=self.parser_name,
|
||||
displayname=displayname)
|
||||
|
|
@ -5528,7 +5522,8 @@ For more information see https://docs.python.org/3/howto/clinic.html""")
|
|||
if rcs_dir in dirs:
|
||||
dirs.remove(rcs_dir)
|
||||
for filename in files:
|
||||
if not (filename.endswith('.c') or filename.endswith('.h')):
|
||||
# handle .c, .cpp and .h files
|
||||
if not filename.endswith(('.c', '.cpp', '.h')):
|
||||
continue
|
||||
path = os.path.join(root, filename)
|
||||
if ns.verbose:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue