From 40f49e3c86e67f8fdd4cd436f52fe77feb913c9d Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Thu, 14 Jun 2012 17:59:24 +0200 Subject: [PATCH] Made doc/make.py working with python 2.4 --- doc/make.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/make.py b/doc/make.py index ed5a4cabc..d02fe47d6 100644 --- a/doc/make.py +++ b/doc/make.py @@ -9,6 +9,12 @@ if len(sys.argv)==2: else: root_dir='.' +def _CheckCall(cmd, shell): + r = subprocess.call(cmd, shell=True) + if r != 0: + sys.stderr.write("Command '%s' returned non-zero exit status %d\n"%(cmd, r)) + sys.exit(-1) + def _OutputPath(inpath, outdir): parts=inpath.split(os.path.sep) filtered_parts=[outdir] @@ -92,17 +98,18 @@ if opts.html: cmd='%s %s -b html -c %s %s %s' % (sphinx_bin, opt_str, 'doc/conf', 'doc/source', 'doc/build/html') print cmd - subprocess.check_call(cmd, shell=True) + _CheckCall(cmd, shell=True) + if opts.doctest: cmd='%s %s -b doctest -c %s %s %s' % (sphinx_bin, opt_str, 'doc/conf', 'doc/source', 'doc/build/doctest') - subprocess.check_call(cmd, shell=True) + _CheckCall(cmd, shell=True) if opts.build_json: cmd='%s %s -b json -c %s %s %s' % (sphinx_bin, opt_str, 'doc/conf', 'doc/source', 'doc/build/json') - subprocess.check_call(cmd, shell=True) + _CheckCall(cmd, shell=True) if opts.linkcheck: cmd='%s %s -b linkcheck -c %s %s %s' % (sphinx_bin, opt_str, 'doc/conf', 'doc/source', 'doc/build/check') - subprocess.check_call(cmd, shell=True) + _CheckCall(cmd, shell=True) -- GitLab