]> granicus.if.org Git - python/commit
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 1 Sep 2019 09:16:51 +0000 (12:16 +0300)
committerGitHub <noreply@github.com>
Sun, 1 Sep 2019 09:16:51 +0000 (12:16 +0300)
commit1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70
tree8db3de2421c1d45d018a7a1dc03f42a0797acee2
parent5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe
bpo-15999: Clean up of handling boolean arguments. (GH-15610)

* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
21 files changed:
Lib/_pyio.py
Lib/codeop.py
Lib/doctest.py
Lib/quopri.py
Lib/test/datetimetester.py
Lib/test/lock_tests.py
Lib/test/test_builtin.py
Lib/test/test_ioctl.py
Lib/test/test_ordered_dict.py
Lib/test/test_unicode.py
Lib/threading.py
Lib/tkinter/__init__.py
Modules/_io/_iomodule.c
Modules/_io/stringio.c
Modules/_io/textio.c
Modules/itertoolsmodule.c
Modules/main.c
Modules/parsermodule.c
Objects/fileobject.c
Python/bltinmodule.c
Python/pylifecycle.c