changeset 311:fe3b8ad915af

fix __float__ to always return a float, for dmxserver
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 16 Jun 2006 16:59:04 +0000
parents 6a4e99505164
children d5c81bb7d822
files light9/updatefreq.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/updatefreq.py	Fri Jun 16 16:58:38 2006 +0000
+++ b/light9/updatefreq.py	Fri Jun 16 16:59:04 2006 +0000
@@ -1,5 +1,6 @@
 """calculates your updates-per-second"""
 
+from __future__ import division
 import time
 
 class Updatefreq:
@@ -27,7 +28,7 @@
         try:
             hz=len(self.times)/(self.times[-1]-self.times[0])
         except ZeroDivisionError:
-            return 0
+            return 0.0
         return hz
     def __str__(self):
         return "%.2fHz"%float(self)