diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-01 12:16:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 12:16:51 +0300 |
commit | 1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 (patch) | |
tree | 8db3de2421c1d45d018a7a1dc03f42a0797acee2 /Lib/quopri.py | |
parent | 5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe (diff) | |
download | cpython-git-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.tar.gz |
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.
Diffstat (limited to 'Lib/quopri.py')
-rwxr-xr-x | Lib/quopri.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/quopri.py b/Lib/quopri.py index cbd979abdf..08899c5cb7 100755 --- a/Lib/quopri.py +++ b/Lib/quopri.py @@ -204,11 +204,11 @@ def main(): print("-t: quote tabs") print("-d: decode; default encode") sys.exit(2) - deco = 0 - tabs = 0 + deco = False + tabs = False for o, a in opts: - if o == '-t': tabs = 1 - if o == '-d': deco = 1 + if o == '-t': tabs = True + if o == '-d': deco = True if tabs and deco: sys.stdout = sys.stderr print("-t and -d are mutually exclusive") |