mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Sjoerd Mullender: cmp.py is obsolete...
This commit is contained in:
parent
eca4784781
commit
6664bb87dc
1 changed files with 2 additions and 5 deletions
|
|
@ -35,11 +35,8 @@ def close(self):
|
|||
self.__file.close()
|
||||
if self.__backup is None:
|
||||
return
|
||||
import cmp
|
||||
# don't use cmp.cmp because of NFS bugs :-( and
|
||||
# anyway, the stat mtime values differ so do_cmp will
|
||||
# most likely be called anyway
|
||||
if cmp.do_cmp(self.__backup, self.__filename):
|
||||
import filecmp
|
||||
if filecmp.cmp(self.__backup, self.__filename, shallow = 0):
|
||||
import os
|
||||
os.unlink(self.__filename)
|
||||
os.rename(self.__backup, self.__filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue