Skip to content

Commit

Permalink
Use tornado.gen.is_future for checking if result is a Future
Browse files Browse the repository at this point in the history
  • Loading branch information
hfaran committed Nov 21, 2014
1 parent 12a6ba3 commit e3576c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tornado_json/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from functools import wraps
from tornado import gen
from tornado.concurrent import Future

from tornado_json.utils import container

Expand Down Expand Up @@ -62,7 +61,7 @@ def _wrapper(self, *args, **kwargs):
output = rh_method(self, *args, **kwargs)
# If the rh_method returned a Future a la `raise Return(value)`
# we grab the output.
if isinstance(output, Future):
if gen.is_future(output):
output = yield output

if output_schema is not None:
Expand Down

0 comments on commit e3576c9

Please sign in to comment.