Skip to content

Commit

Permalink
concurrent: Fix importability of tornado.wsgi on app engine
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Jan 26, 2018
1 parent 606f0b5 commit 6e8a137
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tornado/concurrent.py
Expand Up @@ -337,11 +337,12 @@ def _check_done(self):

def _set_done(self):
self._done = True
from tornado.ioloop import IOLoop
loop = IOLoop.current()
for cb in self._callbacks:
loop.add_callback(cb, self)
self._callbacks = None
if self._callbacks:
from tornado.ioloop import IOLoop
loop = IOLoop.current()
for cb in self._callbacks:
loop.add_callback(cb, self)
self._callbacks = None

# On Python 3.3 or older, objects with a destructor part of a reference
# cycle are never destroyed. It's no longer the case on Python 3.4 thanks to
Expand Down

0 comments on commit 6e8a137

Please sign in to comment.