Skip to content

Commit 476d302

Browse files
authored
gh-93991: Use boolean instead of 0/1 for condition check (GH-93992)
# gh-93991: Use boolean instead of 0/1 for condition check
1 parent 27b9894 commit 476d302

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/filecmp.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ def phase2(self): # Distinguish files, directories, funnies
157157
a_path = os.path.join(self.left, x)
158158
b_path = os.path.join(self.right, x)
159159

160-
ok = 1
160+
ok = True
161161
try:
162162
a_stat = os.stat(a_path)
163163
except OSError:
164164
# print('Can\'t stat', a_path, ':', why.args[1])
165-
ok = 0
165+
ok = False
166166
try:
167167
b_stat = os.stat(b_path)
168168
except OSError:
169169
# print('Can\'t stat', b_path, ':', why.args[1])
170-
ok = 0
170+
ok = False
171171

172172
if ok:
173173
a_type = stat.S_IFMT(a_stat.st_mode)
@@ -242,7 +242,7 @@ def report_full_closure(self): # Report on self and subdirs recursively
242242

243243
methodmap = dict(subdirs=phase4,
244244
same_files=phase3, diff_files=phase3, funny_files=phase3,
245-
common_dirs = phase2, common_files=phase2, common_funny=phase2,
245+
common_dirs=phase2, common_files=phase2, common_funny=phase2,
246246
common=phase1, left_only=phase1, right_only=phase1,
247247
left_list=phase0, right_list=phase0)
248248

0 commit comments

Comments
 (0)