diff --git a/Lib/filecmp.py b/Lib/filecmp.py index 7a4da6beb50500..7da787f4bec05b 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -53,10 +53,10 @@ def cmp(f1, f2, shallow=True): s2 = _sig(os.stat(f2)) if s1[0] != stat.S_IFREG or s2[0] != stat.S_IFREG: return False - if shallow and s1 == s2: - return True - if s1[1] != s2[1]: + if s1 != s2: return False + if shallow: + return True outcome = _cache.get((f1, f2, s1, s2)) if outcome is None: