8000 Update filecmp from CPython 3.12.2 · RustPython/RustPython@f531704 · GitHub
[go: up one dir, main page]

Skip to content

Commit f531704

Browse files
committed
Update filecmp from CPython 3.12.2
1 parent ff052b3 commit f531704

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Lib/filecmp.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
1111
"""
1212

13-
try:
14-
import os
15-
except ImportError:
16-
import _dummy_os as os
13+
import os
1714
import stat
1815
from itertools import filterfalse
1916
from types import GenericAlias
@@ -160,17 +157,17 @@ def phase2(self): # Distinguish files, directories, funnies
160157
a_path = os.path.join(self.left, x)
161158
b_path = os.path.join(self.right, x)
162159

163-
ok = 1
160+
ok = True
164161
try:
165162
a_stat = os.stat(a_path)
166163
except OSError:
167164
# print('Can\'t stat', a_path, ':', why.args[1])
168-
ok = 0
165+
ok = False
169166
try:
170167
b_stat = os.stat(b_path)
171168
except OSError:
172169
# print('Can\'t stat', b_path, ':', why.args[1])
173-
ok = 0
170+
ok = False
174171

175172
if ok:
176173
a_type = stat.S_IFMT(a_stat.st_mode)
@@ -245,7 +242,7 @@ def report_full_closure(self): # Report on self and subdirs recursively
245242

246243
methodmap = dict(subdirs=phase4,
247244
same_files=phase3, diff_files=phase3, funny_files=phase3,
248-
common_dirs = phase2, common_files=phase2, common_funny=phase2,
245+
common_dirs=phase2, common_files=phase2, common_funny=phase2,
249246
common=phase1, left_only=phase1, right_only=phase1,
250247
left_list=phase0, right_list=phase0)
251248

0 commit comments

Comments
 (0)
0