summaryrefslogtreecommitdiffstats
path: root/Lib/filecmp.py
diff options
context:
space:
mode:
authorLei Zhang <leizhanghello@gmail.com>2022-06-19 14:12:59 (GMT)
committerGitHub <noreply@github.com>2022-06-19 14:12:59 (GMT)
commit476d30250811e185615dfb971c6a810cac2093bd (patch)
treecad0062e748f0ce0880ca99181b6b98bdaf46983 /Lib/filecmp.py
parent27b989403356ccdd47545a93aeab8434e9c69f21 (diff)
downloadcpython-476d30250811e185615dfb971c6a810cac2093bd.zip
cpython-476d30250811e185615dfb971c6a810cac2093bd.tar.gz
cpython-476d30250811e185615dfb971c6a810cac2093bd.tar.bz2
gh-93991: Use boolean instead of 0/1 for condition check (GH-93992)
# gh-93991: Use boolean instead of 0/1 for condition check
Diffstat (limited to 'Lib/filecmp.py')
-rw-r--r--Lib/filecmp.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/filecmp.py b/Lib/filecmp.py
index 70a4b23..30bd900 100644
--- a/Lib/filecmp.py
+++ b/Lib/filecmp.py
@@ -157,17 +157,17 @@ class dircmp:
a_path = os.path.join(self.left, x)
b_path = os.path.join(self.right, x)
- ok = 1
+ ok = True
try:
a_stat = os.stat(a_path)
except OSError:
# print('Can\'t stat', a_path, ':', why.args[1])
- ok = 0
+ ok = False
try:
b_stat = os.stat(b_path)
except OSError:
# print('Can\'t stat', b_path, ':', why.args[1])
- ok = 0
+ ok = False
if ok:
a_type = stat.S_IFMT(a_stat.st_mode)
@@ -242,7 +242,7 @@ class dircmp:
methodmap = dict(subdirs=phase4,
same_files=phase3, diff_files=phase3, funny_files=phase3,
- common_dirs = phase2, common_files=phase2, common_funny=phase2,
+ common_dirs=phase2, common_files=phase2, common_funny=phase2,
common=phase1, left_only=phase1, right_only=phase1,
left_list=phase0, right_list=phase0)