[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 4f4b2ae119cfacda2c81e595313cb89657efa959
Author: aagbsn <aagbsn@xxxxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits