From 8c09205e6ec77a0acef72d0086180f9447fc78a3 Mon Sep 17 00:00:00 2001 From: doron zarhi Date: Wed, 27 Jul 2022 21:25:29 +0300 Subject: [PATCH] spawn: use `WEXITSTATUS(x)` to parse exit value --- src/rpcclient/rpcclient/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpcclient/rpcclient/client.py b/src/rpcclient/rpcclient/client.py index ae21fda1..5f0c9e07 100644 --- a/src/rpcclient/rpcclient/client.py +++ b/src/rpcclient/rpcclient/client.py @@ -10,11 +10,11 @@ from collections import namedtuple from enum import Enum from pathlib import Path +from select import select import IPython import xonsh from construct import Int64sl, Float64l, Float32l, Float16l, Int64ul -from select import select from traitlets.config import Config from xonsh.built_ins import XSH @@ -611,7 +611,8 @@ def _execution_loop(self, stdin: io_or_str = sys.stdin, stdout=sys.stdout): stdout.write(data.decode()) stdout.flush() elif exec_chunk.chunk_type == exec_chunk_type_t.CMD_EXEC_CHUNK_TYPE_ERRORCODE: - return exitcode_t.parse(data) + # WEXITSTATUS(x) + return exitcode_t.parse(data) >> 8 def raise_errno_exception(self, message: str): message += f' ({self.last_error})'