[#2889] Fix for UnboundLocalError in exception handler

This commit is contained in:
Calum Lind 2016-10-10 21:57:23 +01:00
parent a7fe4d4510
commit 798f5e2deb

View File

@ -740,7 +740,7 @@ class TorrentManager(component.Component):
os.fsync(state_file.fileno()) os.fsync(state_file.fileno())
state_file.close() state_file.close()
os.rename(filepath_tmp, filepath) os.rename(filepath_tmp, filepath)
except IOError: except IOError, ex:
log.error("Unable to save %s: %s", filepath, ex) log.error("Unable to save %s: %s", filepath, ex)
if os.path.isfile(filepath_bak): if os.path.isfile(filepath_bak):
log.info("Restoring backup of state from: %s", filepath_bak) log.info("Restoring backup of state from: %s", filepath_bak)