From 699440f601523b736d98cfef8f1bddcc2f184a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carn=C3=AB=20Draug?= Date: Sat, 26 Sep 2015 20:42:53 +0100 Subject: doc: do not recommend os.popen which is deprecated in python --- doc/user/tasks.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/user/tasks.xml b/doc/user/tasks.xml index 0bdf678..8026a53 100644 --- a/doc/user/tasks.xml +++ b/doc/user/tasks.xml @@ -96,8 +96,8 @@ filenames = [x for x in filenames if os.path.splitext(x)[1] in extensions] The "backtick function": run a shell command and capture the output -import os -output = os.popen(command).read() +import subprocess +output = subprocess.check_output(command) -- cgit v0.12