summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-12-03 19:52:21 (GMT)
committerGitHub <noreply@github.com>2022-12-03 19:52:21 (GMT)
commita87c46eab3c306b1c5b8a072b7b30ac2c50651c0 (patch)
tree92c0ebdb6abd303ea967c0bd999d839a98f84494 /Modules/_tkinter.c
parentc68573b339320409b038501fdd7d4f8a56766275 (diff)
downloadcpython-a87c46eab3c306b1c5b8a072b7b30ac2c50651c0.zip
cpython-a87c46eab3c306b1c5b8a072b7b30ac2c50651c0.tar.gz
cpython-a87c46eab3c306b1c5b8a072b7b30ac2c50651c0.tar.bz2
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 93d4474..d4a1290 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -2832,7 +2832,7 @@ Tkapp_WantObjects(PyObject *self, PyObject *args)
{
int wantobjects = -1;
- if (!PyArg_ParseTuple(args, "|i:wantobjects", &wantobjects))
+ if (!PyArg_ParseTuple(args, "|p:wantobjects", &wantobjects))
return NULL;
if (wantobjects == -1)
return PyBool_FromLong(((TkappObject*)self)->wantobjects);
@@ -2978,11 +2978,11 @@ _tkinter.create
screenName: str(accept={str, NoneType}) = None
baseName: str = ""
className: str = "Tk"
- interactive: bool(accept={int}) = False
- wantobjects: bool(accept={int}) = False
- wantTk: bool(accept={int}) = True
+ interactive: bool = False
+ wantobjects: bool = False
+ wantTk: bool = True
if false, then Tk_Init() doesn't get called
- sync: bool(accept={int}) = False
+ sync: bool = False
if true, then pass -sync to wish
use: str(accept={str, NoneType}) = None
if not None, then pass -use to wish
@@ -2995,7 +2995,7 @@ _tkinter_create_impl(PyObject *module, const char *screenName,
const char *baseName, const char *className,
int interactive, int wantobjects, int wantTk, int sync,
const char *use)
-/*[clinic end generated code: output=e3315607648e6bb4 input=da9b17ee7358d862]*/
+/*[clinic end generated code: output=e3315607648e6bb4 input=09afef9adea70a19]*/
{
/* XXX baseName is not used anymore;
* try getting rid of it. */