From 0ab275271efd336a6cfd9818ff09bd912fedcf47 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sat, 18 Jun 2022 10:39:03 -0700 Subject: [PATCH 1/2] Use boolean instead of 0/1 for condition check --- Lib/filecmp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/filecmp.py b/Lib/filecmp.py index 70a4b23c982205..fe7d5e5fe88ab5 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -157,17 +157,17 @@ def phase2(self): # Distinguish files, directories, funnies 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) From b6355d01353d859830502e0e3243b5b81e9e9821 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sat, 18 Jun 2022 20:40:46 -0700 Subject: [PATCH 2/2] Fix coding style for a function default parameter --- Lib/filecmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/filecmp.py b/Lib/filecmp.py index fe7d5e5fe88ab5..30bd900fa805aa 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -242,7 +242,7 @@ def report_full_closure(self): # Report on self and subdirs recursively 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) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy