From f9956f913a804cbcaf2e390fce6405a0b62c29f1 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Sun, 12 Jan 2014 21:22:32 +0100 Subject: [PATCH] subprocess: don't use wait() http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait Je n'avais pas lu le warning ... --- client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client.py b/client.py index d0f43ef..7b4a49f 100755 --- a/client.py +++ b/client.py @@ -300,9 +300,11 @@ def remote_command(options, command, arg=None, stdin_contents=None): proc = remote_proc(options, command, arg) if stdin_contents is not None: proc.stdin.write(json.dumps(stdin_contents)) - proc.stdin.close() - ret = proc.wait() - raw_out = proc.stdout.read() + proc.stdin.flush() + + raw_out, raw_err = proc.communicate() + ret = proc.returncode + if ret != 0: if not options.quiet: print((u"Mauvais code retour côté serveur, voir erreur " +