]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix TwistedIOLoop on python 2.6.
authorBen Darnell <ben@bendarnell.com>
Sat, 9 Mar 2013 00:03:49 +0000 (19:03 -0500)
committerBen Darnell <ben@bendarnell.com>
Sat, 9 Mar 2013 00:03:49 +0000 (19:03 -0500)
tornado/platform/twisted.py
tox.ini

index 240997f0c5ce1ea3ce4018b2fb183b141e32e489..3cd7b4b5be2a2f573f6092653f0869964acf31b1 100644 (file)
@@ -472,7 +472,7 @@ class TwistedIOLoop(tornado.ioloop.IOLoop):
         if isinstance(deadline, (int, long, float)):
             delay = max(deadline - self.time(), 0)
         elif isinstance(deadline, datetime.timedelta):
-            delay = deadline.total_seconds()
+            delay = tornado.ioloop._Timeout.timedelta_to_seconds(deadline)
         else:
             raise TypeError("Unsupported deadline %r")
         return self.reactor.callLater(delay, self._run_callback, wrap(callback))
diff --git a/tox.ini b/tox.ini
index e84a50e22fadf1fe673b4a1ced95b2834b8269be..fa4a46d55ffbf462920d47341bbd33b325846adc 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -71,6 +71,16 @@ deps =
      twisted>=12.0.0
 commands = python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop {posargs:}
 
+[testenv:py26-twisted]
+basepython = python2.6
+deps =
+     futures
+     mock
+     pycurl
+     twisted>=12.3.0
+     unittest2
+commands = python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop {posargs:}
+
 [testenv:py27-twisted]
 basepython = python2.7
 deps =