From 1132292e9e27f1d4f49465094ae6ff089ec2d8c3 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 6 Mar 2008 12:22:48 +0000 Subject: [PATCH] fix damn stupid fast resume for real --- src/core.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/core.py b/src/core.py index b1d80788e..1245ee58c 100644 --- a/src/core.py +++ b/src/core.py @@ -474,11 +474,14 @@ class Manager: if not state['is_seed'] and state['state'] != 0 and state['state'] != 1: os.remove(self.unique_IDs[unique_ID].filename + ".fastresume") deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename) + except OSError: + print "no old fastresume to delete" + try: + deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename) + except: + pass except Exception, e: - if "No such file or directory" in e: - print "no old fastresume to delete" - else: - print "Unable to save fastresume: ", e + print "Unable to save fastresume: ", e else: # Do not save fastresume if torrent is Queued for checking or being checked try: @@ -487,11 +490,14 @@ class Manager: return os.remove(self.unique_IDs[uid].filename + ".fastresume") deluge_core.save_fastresume(uid, self.unique_IDs[uid].filename) + except OSError: + print "no old fastresume to delete" + try: + deluge_core.save_fastresume(uid, self.unique_IDs[uid].filename) + except: + pass except Exception, e: - if "No such file or directory" in e: - print "no old fastresume to delete" - else: - print "Unable to save fastresume: ", e + print "Unable to save fastresume: ", e return True # State retrieval functions