mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812)
TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.
This commit is contained in:
parent
d609b0c24e
commit
afad147b59
1 changed files with 1 additions and 1 deletions
|
|
@ -353,10 +353,10 @@ def getFilesToDelete(self):
|
|||
suffix = fileName[plen:]
|
||||
if self.extMatch.match(suffix):
|
||||
result.append(os.path.join(dirName, fileName))
|
||||
result.sort()
|
||||
if len(result) < self.backupCount:
|
||||
result = []
|
||||
else:
|
||||
result.sort()
|
||||
result = result[:len(result) - self.backupCount]
|
||||
return result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue