Merge pull request #47363 from DSRCorporation/bugs/replace_exc_info_with_exception

Tornado5.0: Future.exc_info is dropped
This commit is contained in:
Daniel Wallace 2018-04-27 13:30:17 -05:00 committed by GitHub
commit bcc66dd9bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -1057,7 +1057,7 @@ class Minion(MinionBase):
# I made the following 3 line oddity to preserve traceback.
# Please read PR #23978 before changing, hopefully avoiding regressions.
# Good luck, we're all counting on you. Thanks.
future_exception = self._connect_master_future.exc_info()
future_exception = self._connect_master_future.exception()
if future_exception:
# This needs to be re-raised to preserve restart_on_error behavior.
raise six.reraise(*future_exception)

View file

@ -296,7 +296,7 @@ class IPCClient(object):
else:
if hasattr(self, '_connecting_future'):
# read previous future result to prevent the "unhandled future exception" error
self._connecting_future.exc_info() # pylint: disable=E0203
self._connecting_future.exception() # pylint: disable=E0203
future = tornado.concurrent.Future()
self._connecting_future = future
self._connect(timeout=timeout)
@ -753,9 +753,9 @@ class IPCMessageSubscriber(IPCClient):
# '[ERROR ] Future exception was never retrieved:
# StreamClosedError'
if self._read_sync_future is not None:
self._read_sync_future.exc_info()
self._read_sync_future.exception()
if self._read_stream_future is not None:
self._read_stream_future.exc_info()
self._read_stream_future.exception()
def __del__(self):
if IPCMessageSubscriber in globals():

View file

@ -886,7 +886,7 @@ class SaltMessageClient(object):
# This happens because the logic is always waiting to read
# the next message and the associated read future is marked
# 'StreamClosedError' when the stream is closed.
self._read_until_future.exc_info()
self._read_until_future.exception()
if (not self._stream_return_future.done() and
self.io_loop != tornado.ioloop.IOLoop.current(
instance=False)):
@ -1139,7 +1139,7 @@ class Subscriber(object):
# This happens because the logic is always waiting to read
# the next message and the associated read future is marked
# 'StreamClosedError' when the stream is closed.
self._read_until_future.exc_info()
self._read_until_future.exception()
def __del__(self):
self.close()