[tor-commits] [bridgedb/master] 5482 - Do Not Divide by Zero

aagbsn at torproject.org aagbsn at torproject.org
Wed Apr 17 00:26:44 UTC 2013


commit 4f4b2ae119cfacda2c81e595313cb89657efa959
Author: aagbsn <aagbsn at extc.org>
Date:   Tue Oct 30 07:38:28 2012 -0700

    5482 - Do Not Divide by Zero
---
 lib/bridgedb/Stability.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/bridgedb/Stability.py b/lib/bridgedb/Stability.py
index 0c2a288..a54e67c 100644
--- a/lib/bridgedb/Stability.py
+++ b/lib/bridgedb/Stability.py
@@ -88,6 +88,7 @@ class BridgeHistory(object):
     @property
     def weightedFractionalUptime(self):
         """Weighted Fractional Uptime"""
+        if self.weightedTime <0.0001: return long(0)
         return long(10000) * self.weightedUptime / self.weightedTime
 
     @property





More information about the tor-commits mailing list