Skip to content

Commit f3fa946

Browse files
committed
Removed deprecated use_statcache argument.
1 parent 664347b commit f3fa946

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

Doc/lib/libfilecmp.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ \section{\module{filecmp} ---
1111

1212
The \module{filecmp} module defines the following functions:
1313

14-
\begin{funcdesc}{cmp}{f1, f2\optional{, shallow\optional{, use_statcache}}}
14+
\begin{funcdesc}{cmp}{f1, f2\optional{, shallow}}
1515
Compare the files named \var{f1} and \var{f2}, returning \code{True} if
1616
they seem equal, \code{False} otherwise.
1717

1818
Unless \var{shallow} is given and is false, files with identical
1919
\function{os.stat()} signatures are taken to be equal.
20-
\versionchanged[\var{use_statcache} is obsolete and ignored.]{2.3}
2120

2221
Files that were compared using this function will not be compared again
2322
unless their \function{os.stat()} signature changes.
@@ -27,7 +26,7 @@ \section{\module{filecmp} ---
2726
\end{funcdesc}
2827

2928
\begin{funcdesc}{cmpfiles}{dir1, dir2, common\optional{,
30-
shallow\optional{, use_statcache}}}
29+
shallow}}
3130
Returns three lists of file names: \var{match}, \var{mismatch},
3231
\var{errors}. \var{match} contains the list of files match in both
3332
directories, \var{mismatch} includes the names of those that don't,
@@ -37,8 +36,8 @@ \section{\module{filecmp} ---
3736
the comparison could not be done for some reason.
3837

3938
The \var{common} parameter is a list of file names found in both directories.
40-
The \var{shallow} and \var{use_statcache} parameters have the same
41-
meanings and default values as for \function{filecmp.cmp()}.
39+
The \var{shallow} parameter has the same
40+
meaning and default value as for \function{filecmp.cmp()}.
4241
\end{funcdesc}
4342

4443
Example:

Lib/filecmp.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_cache = {}
2020
BUFSIZE=8*1024
2121

22-
def cmp(f1, f2, shallow=1, use_statcache=None):
22+
def cmp(f1, f2, shallow=1):
2323
"""Compare two files.
2424
2525
Arguments:
@@ -31,8 +31,6 @@ def cmp(f1, f2, shallow=1, use_statcache=None):
3131
shallow -- Just check stat signature (do not read the files).
3232
defaults to 1.
3333
34-
use_statcache -- obsolete argument.
35-
3634
Return value:
3735
3836
True if the files are the same, False otherwise.
@@ -41,9 +39,6 @@ def cmp(f1, f2, shallow=1, use_statcache=None):
4139
with a cache invalidation mechanism relying on stale signatures.
4240
4341
"""
44-
if use_statcache is not None:
45-
warnings.warn("use_statcache argument is deprecated",
46-
DeprecationWarning)
4742

4843
s1 = _sig(os.stat(f1))
4944
s2 = _sig(os.stat(f2))
@@ -244,23 +239,19 @@ def __getattr__(self, attr):
244239
self.methodmap[attr](self)
245240
return getattr(self, attr)
246241

247-
def cmpfiles(a, b, common, shallow=1, use_statcache=None):
242+
def cmpfiles(a, b, common, shallow=1):
248243
"""Compare common files in two directories.
249244
250245
a, b -- directory names
251246
common -- list of file names found in both directories
252247
shallow -- if true, do comparison based solely on stat() information
253-
use_statcache -- obsolete argument
254248
255249
Returns a tuple of three lists:
256250
files that compare equal
257251
files that are different
258252
filenames that aren't regular files.
259253
260254
"""
261-
if use_statcache is not None:
262-
warnings.warn("use_statcache argument is deprecated",
263-
DeprecationWarning)
264255
res = ([], [], [])
265256
for x in common:
266257
ax = os.path.join(a, x)

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Extension Modules
2121
Library
2222
-------
2323

24+
- the filecmp module no longer uses the deprecated use_statcache argument.
25+
2426
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
2527
extended or overridden by subclasses. Formerly, the subclassed method would
2628
be ignored by the rest of the module. (Bug #1078905).

0 commit comments

Comments
 (0)