summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-10-23 06:45:21 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-10-23 06:45:21 +0000
commitd17f6ee274404ecd1fd0f3ac2389a0fc19fc8b4b (patch)
tree504aa36981a1c3cc55115f0f8fdfda7dfc3d6da7
parent571ecbdfac404d140219c5f00444967d8a69ba07 (diff)
downloaddeluge-d17f6ee274404ecd1fd0f3ac2389a0fc19fc8b4b.tar.gz
deluge-d17f6ee274404ecd1fd0f3ac2389a0fc19fc8b4b.tar.bz2
deluge-d17f6ee274404ecd1fd0f3ac2389a0fc19fc8b4b.zip
fix attribute error
-rw-r--r--src/core.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py
index 5f922fc17..26fac7077 100644
--- a/src/core.py
+++ b/src/core.py
@@ -984,7 +984,10 @@ class Manager:
# Calculations
def calc_ratio(self, unique_ID, torrent_state):
- up = float((self.unique_IDs[unique_ID].initial_uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024)
+ try:
+ up = float((self.unique_IDs[unique_ID].initial_uploaded_memory + self.get_core_torrent_state(unique_ID, False)['total_upload']) / 1024)
+ except AttributeError:
+ up = float(self.get_core_torrent_state(unique_ID, False) / 1024)
down = float(torrent_state["total_done"] / 1024)
try:
ret = up/down