From a4a7fabfdfe68676346e9f9d44daf1c91b23ab96 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 29 Dec 2014 20:21:49 +0000 Subject: [PATCH] Fix type mismatches in save file rotation The numeric suffix on rotated save files needs to be treated as an int during rotation calculations but as a str during filename generation. Make it so. --- lib/mudpy/data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mudpy/data.py b/lib/mudpy/data.py index b7d173b..3eddc43 100644 --- a/lib/mudpy/data.py +++ b/lib/mudpy/data.py @@ -133,13 +133,13 @@ class DataFile: backups.reverse() for old_backup in backups: if old_backup >= max_count - 1: - os.remove(self.filename + "." + old_backup) + os.remove(self.filename + "." + str(old_backup)) elif not os.path.exists( - self.filename + "." + old_backup + 1 + self.filename + "." + str(old_backup + 1) ): os.rename( - self.filename + "." + old_backup, - self.filename + "." + old_backup + 1 + self.filename + "." + str(old_backup), + self.filename + "." + str(old_backup + 1) ) if not os.path.exists(self.filename + ".0"): os.rename(self.filename, self.filename + ".0") -- 2.11.0