pusher / pusher-http-python

Pusher Channels HTTP API library for Python
https://pusher.com/docs/server_api_guide
MIT License
376 stars 113 forks source link

Tornado backend does not work with Tornado 5.x #115

Closed zdexter closed 6 years ago

zdexter commented 6 years ago

The deprecated alias tornado.concurrent.TracebackFuture has been removed.

https://github.com/tornadoweb/tornado/blob/f6e98e279bf78d2984351062906eb100a7303c35/docs/releases/v5.0.0.rst#tornadoconcurrent

from pusher.tornado import TornadoBackend
from tornado.concurrent import TracebackFuture
ImportError: cannot import name 'TracebackFuture'
zdexter commented 6 years ago

looks like the solution is to use tornado.concurrent.Future:

 .. versionchanged:: 5.0

       This class was previoiusly available under the name
       ``TracebackFuture``. This name, which was deprecated since
       version 4.0, has been removed. When `asyncio` is available
       ``tornado.concurrent.Future`` is now an alias for
       `asyncio.Future`. Like `asyncio.Future`, callbacks are now
       always scheduled on the `.IOLoop` and are never run
       synchronously.

http://www.tornadoweb.org/en/stable/_modules/tornado/concurrent.html

WillSewell commented 6 years ago

Thanks for reporting this. Tornado 4.0 was released over 4 years ago now. I think we can drop support for earlier versions at this point. I'll create a PR to switch to tornado.concurrent.Future.

WillSewell commented 6 years ago

The fix is in the latest release: v2.0.2