Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
276123d1
Commit
276123d1
authored
Oct 24, 1990
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed use of stat.
parent
336f2816
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Lib/cmpcache.py
Lib/cmpcache.py
+3
-3
No files found.
Lib/cmpcache.py
View file @
276123d1
...
...
@@ -10,7 +10,7 @@
# - We don't fork a process to run 'cmp' but read the files ourselves
import
posix
import
stat
from
stat
import
*
import
statcache
...
...
@@ -26,7 +26,7 @@ def cmp(f1, f2):
# Return 1 for identical files, 0 for different.
# Raise exceptions if either file could not be statted, read, etc.
s1
,
s2
=
sig
(
statcache
.
stat
(
f1
)),
sig
(
statcache
.
stat
(
f2
))
if
not
stat
.
S_ISREG
(
s1
[
0
])
or
not
stat
.
S_ISREG
(
s2
[
0
]):
if
not
S_ISREG
(
s1
[
0
])
or
not
S_ISREG
(
s2
[
0
]):
# Either is a not a plain file -- always report as different
return
0
if
s1
=
s2
:
...
...
@@ -52,7 +52,7 @@ def cmp(f1, f2):
# Return signature (i.e., type, size, mtime) from raw stat data.
#
def
sig
(
st
):
return
stat
.
S_IFMT
(
st
[
ST_MODE
]),
st
[
stat
.
ST_SIZE
],
st
[
stat
.
ST_MTIME
]
return
S_IFMT
(
st
[
ST_MODE
]),
st
[
ST_SIZE
],
st
[
ST_MTIME
]
# Compare two files, really.
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment