Skip to content

Conversation

@drmikehenry
Copy link
Contributor

Problem: python interpreter exit status is ignored by pynvim-python.

For example:

$ pynvim-python -c 'import sys; sys.exit(5)'; echo $?
0

Solution: propagate the exit status from pynvim-python.

Use sys.exit() to return the interpreter's exit status as found in subprocess.run().returncode:

$ pynvim-python -c 'import sys; sys.exit(5)'; echo $?
5

Despite the number of times I read over this code, I'm sorry to say I failed to notice the expected sys.exit() was missing. This week, I woke from a sound sleep in the middle of the night with the thought that I didn't remember seeing sys.exit(); I got up to check, and sure enough I'd left it off.

Problem: python interpreter exit status is ignored by pynvim-python.

For example:

```console
$ pynvim-python -c 'import sys; sys.exit(5)'; echo $?
0
```

Solution: propagate the exit status from pynvim-python.

Use `sys.exit()` to return the interpreter's exit status as found in `subprocess.run().returncode`:

```console
$ pynvim-python -c 'import sys; sys.exit(5)'; echo $?
5
```
@justinmk justinmk merged commit c59abe4 into neovim:master Sep 13, 2025
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants