From d5bef9efb514046050f6e08b70bbed7247a1a62f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Nov 2021 21:48:17 +0100 Subject: [PATCH] Python: document which exception is thrown on process failure --- src/modules/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/README.md b/src/modules/README.md index 683ca9bc3..7b4d4b3a3 100644 --- a/src/modules/README.md +++ b/src/modules/README.md @@ -398,7 +398,9 @@ target_env_process_output(["ls"]) ``` The functions return 0. If the exit code of *command* is not 0, an exception -is raised instead of returning 0. +is raised instead of returning 0. The exception is `subprocess.CalledProcessError` +(as if the *subprocess* module had been used), and the `returncode` member +of the exception object can be used to determine the exit code. Parameter *stdin* may be a string which is fed to the command as standard input. The *timeout* is in seconds, with 0 (or a negative number) treated as no-timeout.