Kaydet (Commit) 65dffe58 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) Vinay Sajip

bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812) (GH-4466)

TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.
(cherry picked from commit afad147b)
üst 80baec58
......@@ -356,10 +356,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment