]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix default IOLoop in Subprocess.
authorBen Darnell <ben@bendarnell.com>
Wed, 12 Jun 2013 03:52:36 +0000 (23:52 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 12 Jun 2013 03:52:36 +0000 (23:52 -0400)
Exit callbacks would fail for Subprocesses that did not explicitly
set an IOLoop.

tornado/process.py

index 5f05b182820d70516df794328aaee91772a43c83..9bc193c01a2bf77b21d54b338a91ea1ca421bca3 100644 (file)
@@ -189,7 +189,7 @@ class Subprocess(object):
     _waiting = {}
 
     def __init__(self, *args, **kwargs):
-        self.io_loop = kwargs.pop('io_loop', None)
+        self.io_loop = kwargs.pop('io_loop', None) or ioloop.IOLoop.current()
         to_close = []
         if kwargs.get('stdin') is Subprocess.STREAM:
             in_r, in_w = _pipe_cloexec()