]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Added more sensical callback time verification. 616/head
authorPeter Sobot <github@petersobot.com>
Tue, 23 Oct 2012 21:06:08 +0000 (18:06 -0300)
committerPeter Sobot <github@petersobot.com>
Tue, 23 Oct 2012 21:06:08 +0000 (18:06 -0300)
tornado/ioloop.py

index dfbb462b3417e0e2d431c5fe4803b3e170db9f0a..5f01223be7ef41ca5444aa249caf07ac75094e06 100644 (file)
@@ -679,8 +679,8 @@ class PeriodicCallback(object):
     """
     def __init__(self, callback, callback_time, io_loop=None):
         self.callback = callback
-        if callback_time == 0:
-            raise ValueError("Periodic callback cannot have a period of 0ms")
+        if callback_time <= 0:
+            raise ValueError("Periodic callback must have a positive callback_time")
         self.callback_time = callback_time
         self.io_loop = io_loop or IOLoop.instance()
         self._running = False