mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-132753: Argument Clinic: Fix support of c_default for the bool converter (GH-132754)
This commit is contained in:
parent
dc4a7077ac
commit
78cfee6f09
4 changed files with 86 additions and 2 deletions
|
@ -30,7 +30,8 @@ class bool_converter(CConverter):
|
|||
fail(f"bool_converter: illegal 'accept' argument {accept!r}")
|
||||
if self.default is not unspecified and self.default is not unknown:
|
||||
self.default = bool(self.default)
|
||||
self.c_default = str(int(self.default))
|
||||
if self.c_default in {'Py_True', 'Py_False'}:
|
||||
self.c_default = str(int(self.default))
|
||||
|
||||
def parse_arg(self, argname: str, displayname: str, *, limited_capi: bool) -> str | None:
|
||||
if self.format_unit == 'i':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue