summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/logging/handlers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 2f934b3..daa71ab 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -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