From 53452e8d5a40c9befdd6f4aeb8d6b881fa7c9897 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 19 May 2012 14:22:03 -0700 Subject: [PATCH] Fight bitrot in tornado.platform.twisted. A new release of zope.interface breaks things on python 2.5, and sets off our (overly-sensitive?) deprecation checking. --- tornado/platform/twisted.py | 7 ++++++- tornado/test/runtests.py | 11 +++++++++-- tox.ini | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tornado/platform/twisted.py b/tornado/platform/twisted.py index 564c5f8f97..044c333417 100644 --- a/tornado/platform/twisted.py +++ b/tornado/platform/twisted.py @@ -41,7 +41,7 @@ before closing the `IOLoop`. -This module has been tested with Twisted versions 11.0.0 and 11.1.0. +This module has been tested with Twisted versions 11.0.0, 11.1.0, and 12.0.0 """ from __future__ import absolute_import, division, with_statement @@ -66,6 +66,11 @@ class TornadoDelayedCall(object): """DelayedCall object for Tornado.""" + # Note that zope.interface.implements is deprecated in + # zope.interface 4.0, because it cannot work in python 3. The + # replacement is a class decorator, which cannot work on python + # 2.5. So when twisted supports python 3, we'll need to drop 2.5 + # support on this module to make it work. implements(IDelayedCall) def __init__(self, reactor, seconds, f, *args, **kw): diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index 8bf8eef9b5..4235aba18a 100755 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -42,11 +42,18 @@ def all(): # ignored by default, including DeprecationWarnings and # python 3.2's ResourceWarnings. warnings.filterwarnings("error") - # Tornado shouldn't use anything deprecated, but some of our - # dependencies do (last match wins). + # Tornado generally shouldn't use anything deprecated, but some of + # our dependencies do (last match wins). warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("error", category=DeprecationWarning, module=r"tornado\..*") + # tornado.platform.twisted uses a deprecated function from + # zope.interface in order to maintain compatibility with + # python 2.5 + warnings.filterwarnings("ignore", category=DeprecationWarning, + module=r"tornado\.platform\.twisted") + warnings.filterwarnings("ignore", category=DeprecationWarning, + module=r"tornado\.test\.twisted_test") import tornado.testing tornado.testing.main() diff --git a/tox.ini b/tox.ini index 5468c89038..40909881cd 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,8 @@ deps = pycurl simplejson twisted>=12.0.0 + # zope.interface (used by twisted) dropped python 2.5 support in 4.0 + zope.interface<4.0 # py26-full deliberately runs an older version of twisted to ensure # we're still compatible with the oldest version we support.