Skip to content

Commit

Permalink
asyncio: use stderr fd constant
Browse files Browse the repository at this point in the history
sys.stderr might be monkey-patched by other library, and not always
work. also it gives the impression the stderr stream of the python process
is used which it isn't.
  • Loading branch information
bfredl committed Aug 20, 2016
1 parent 4280e49 commit 36b2732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neovim/msgpack_rpc/event_loop/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def pipe_connection_lost(self, fd, exc):

def pipe_data_received(self, fd, data):
"""Used to signal `asyncio.SubprocessProtocol` of incoming data."""
if fd == sys.stderr.fileno():
if fd == 2: # stderr fd number
self._on_stderr(data)
elif self._on_data:
self._on_data(data)
Expand Down

0 comments on commit 36b2732

Please sign in to comment.