Skip to content

Commit 2db6bee

Browse files
committed
Don't use BaseException.message @equalsraf
BaseException.message was only available in Python 2.5: https://www.python.org/dev/peps/pep-0352/#retracted-ideas This was patch was proposed in neovim/neovim #4253: neovim/neovim#4253 (comment) This hides any errors behind an AttributeError: AttributeError: 'OSError' object has no attribute 'message'
1 parent 4373c94 commit 2db6bee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neovim/msgpack_rpc/event_loop/asyncio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def connection_made(self, transport):
4444

4545
def connection_lost(self, exc):
4646
"""Used to signal `asyncio.Protocol` of a lost connection."""
47-
self._on_error(exc.message if exc else 'EOF')
47+
self._on_error(exc.args[0] if exc else 'EOF')
4848

4949
def data_received(self, data):
5050
"""Used to signal `asyncio.Protocol` of incoming data."""
@@ -55,7 +55,7 @@ def data_received(self, data):
5555

5656
def pipe_connection_lost(self, fd, exc):
5757
"""Used to signal `asyncio.SubprocessProtocol` of a lost connection."""
58-
self._on_error(exc.message if exc else 'EOF')
58+
self._on_error(exc.args[0] if exc else 'EOF')
5959

6060
def pipe_data_received(self, fd, data):
6161
"""Used to signal `asyncio.SubprocessProtocol` of incoming data."""

0 commit comments

Comments
 (0)