From: Eden Li Date: Thu, 31 May 2012 00:32:29 +0000 (-0700) Subject: Restore context for all read methods. X-Git-Tag: v2.3.0~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c19333132ec568eb881401a47ab83db4a3cae2a;p=thirdparty%2Ftornado.git Restore context for all read methods. Prior to 2db0aceb32f5c042f5306e72a4679580b4359f34 this was being done properly, but the refactor removed stack_context.wrap causing some issues in our upstream context managers. --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 47e981b41..6db0fdfc5 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -366,7 +366,7 @@ class IOStream(object): def _set_read_callback(self, callback): assert not self._read_callback, "Already reading" - self._read_callback = callback + self._read_callback = stack_context.wrap(callback) def _try_inline_read(self): """Attempt to complete the current read operation from buffered data.