Skip to content

Commit c59abe4

Browse files
authored
fix: return python interpreter exit status from pynvim-python #599
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 ```
1 parent d0d933a commit c59abe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pynvim/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525

2626
def main() -> None:
2727
"""Chain to Python interpreter, passing all command-line args."""
28-
subprocess.run([sys.executable] + sys.argv[1:])
28+
sys.exit(subprocess.run([sys.executable] + sys.argv[1:]).returncode)

0 commit comments

Comments
 (0)