]> git.ipfire.org Git - thirdparty/tornado.git/commit
Avoid IOStream.close(exc_info=True) 2028/head
authorAntoine Pitrou <antoine@python.org>
Thu, 27 Apr 2017 14:29:10 +0000 (16:29 +0200)
committerAntoine Pitrou <antoine@python.org>
Thu, 27 Apr 2017 14:29:10 +0000 (16:29 +0200)
commit7c969663dd6c422e97d77780cf25cc9d3e66ea90
treea3b180237906a521a7d1bb4297decf0cd2094980
parent305d559ff7608275ca7547a35f8a0cb62fcfc657
Avoid IOStream.close(exc_info=True)

close(exc_info=True) calls sys.exc_info() to get the "current" exception.
Unfortunately, on Python 2 this is the last raised exception even if it
was caught and silenced (by contrast with Python 3, which has lexically
nested exceptions).  This could set ``IOStream.error`` and therefore
``TCPClient.connect``'s raised exception to the wrong error.

Fix by passing the explicit error instance instead.
tornado/iostream.py