Skip to content

Commit

Permalink
Merge pull request #204 from doronz88/bugfix/spawn_exit_value
Browse files Browse the repository at this point in the history
spawn: use `WEXITSTATUS(x)` to parse exit value
  • Loading branch information
doronz88 authored Jul 27, 2022
2 parents 8c61b04 + 8c09205 commit 6aef2de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rpcclient/rpcclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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})'
Expand Down

0 comments on commit 6aef2de

Please sign in to comment.