File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010# - We don't fork a process to run 'cmp' but read the files ourselves
1111
1212import posix
13- import stat
13+ from stat import *
1414import 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#
5454def 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#
You can’t perform that action at this time.
0 commit comments