# HG changeset patch # User Drew Perttula # Date 2006-06-16 16:59:04 # Node ID fe3b8ad915af42ef70ba566f45cbe2f341c5447f # Parent 6a4e99505164ed4dc2810cc86d746fb9e1ea9a59 fix __float__ to always return a float, for dmxserver diff --git a/light9/updatefreq.py b/light9/updatefreq.py --- a/light9/updatefreq.py +++ b/light9/updatefreq.py @@ -1,5 +1,6 @@ """calculates your updates-per-second""" +from __future__ import division import time class Updatefreq: @@ -27,7 +28,7 @@ class Updatefreq: 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)