Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 276123d

Browse files
committed
Changed use of stat.
1 parent 336f281 commit 276123d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/cmpcache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# - We don't fork a process to run 'cmp' but read the files ourselves
1111

1212
import posix
13-
import stat
13+
from stat import *
1414
import statcache
1515

1616

@@ -26,7 +26,7 @@ def cmp(f1, f2):
2626
# Return 1 for identical files, 0 for different.
2727
# Raise exceptions if either file could not be statted, read, etc.
2828
s1, s2 = sig(statcache.stat(f1)), sig(statcache.stat(f2))
29-
if not stat.S_ISREG(s1[0]) or not stat.S_ISREG(s2[0]):
29+
if not S_ISREG(s1[0]) or not S_ISREG(s2[0]):
3030
# Either is a not a plain file -- always report as different
3131
return 0
3232
if s1 = s2:
@@ -52,7 +52,7 @@ def cmp(f1, f2):
5252
# Return signature (i.e., type, size, mtime) from raw stat data.
5353
#
5454
def sig(st):
55-
return stat.S_IFMT(st[ST_MODE]), st[stat.ST_SIZE], st[stat.ST_MTIME]
55+
return S_IFMT(st[ST_MODE]), st[ST_SIZE], st[ST_MTIME]
5656

5757
# Compare two files, really.
5858
#

0 commit comments

Comments
 (0)