Skip to content

Commit

Permalink
Fight bitrot in tornado.platform.twisted.
Browse files Browse the repository at this point in the history
A new release of zope.interface breaks things on python 2.5, and
sets off our (overly-sensitive?) deprecation checking.
  • Loading branch information
bdarnell committed May 19, 2012
1 parent f618c2f commit 53452e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tornado/platform/twisted.py
Expand Up @@ -41,7 +41,7 @@
before closing the `IOLoop`. 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 from __future__ import absolute_import, division, with_statement
Expand All @@ -66,6 +66,11 @@


class TornadoDelayedCall(object): class TornadoDelayedCall(object):
"""DelayedCall object for Tornado.""" """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.

This comment has been minimized.

Copy link
@alekstorm

alekstorm Jun 29, 2012

Owner

I'm not an expert on Zope, but can't 2.5 work by doing this:

class Foo(object):
   # ...contents...
Foo = zope.interface.implementer(IBar)(Foo)

This comment has been minimized.

Copy link
@bdarnell

bdarnell Jun 29, 2012

Author

Um, yeah, I don't see any reason that wouldn't work ;)

implements(IDelayedCall) implements(IDelayedCall)


def __init__(self, reactor, seconds, f, *args, **kw): def __init__(self, reactor, seconds, f, *args, **kw):
Expand Down
11 changes: 9 additions & 2 deletions tornado/test/runtests.py
Expand Up @@ -42,11 +42,18 @@ def all():
# ignored by default, including DeprecationWarnings and # ignored by default, including DeprecationWarnings and
# python 3.2's ResourceWarnings. # python 3.2's ResourceWarnings.
warnings.filterwarnings("error") warnings.filterwarnings("error")
# Tornado shouldn't use anything deprecated, but some of our # Tornado generally shouldn't use anything deprecated, but some of
# dependencies do (last match wins). # our dependencies do (last match wins).
warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("error", category=DeprecationWarning, warnings.filterwarnings("error", category=DeprecationWarning,
module=r"tornado\..*") 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 import tornado.testing
tornado.testing.main() tornado.testing.main()
2 changes: 2 additions & 0 deletions tox.ini
Expand Up @@ -37,6 +37,8 @@ deps =
pycurl pycurl
simplejson simplejson
twisted>=12.0.0 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 # py26-full deliberately runs an older version of twisted to ensure
# we're still compatible with the oldest version we support. # we're still compatible with the oldest version we support.
Expand Down

0 comments on commit 53452e8

Please sign in to comment.