Commit d82ab34b authored by Patrick Godwin's avatar Patrick Godwin

sphinx-bindoc: add try/except loop in reading help messages from scripts to...

sphinx-bindoc: add try/except loop in reading help messages from scripts to skip problematic scripts
parent 2c34dac0
Pipeline #78634 passed with stages
in 29 minutes and 58 seconds
......@@ -58,10 +58,13 @@ for prog in sorted(os.listdir(indir)):
# write the output of --help
f.write("%s\n%s\n\n" % ("Command line options", "".join(["-"] * len("Command line options"))))
f.write("\n\n.. code-block:: none\n\n")
proc = subprocess.Popen([path_to_prog, "--help"], stdout = subprocess.PIPE)
helpmessage = proc.communicate()[0]
helpmessage = "\n".join([" %s" % l for l in helpmessage.split("\n")])
f.write(helpmessage)
try:
proc = subprocess.Popen([path_to_prog, "--help"], stdout = subprocess.PIPE)
helpmessage = proc.communicate()[0]
helpmessage = "\n".join([" %s" % l for l in helpmessage.split("\n")])
f.write(helpmessage)
except OSError:
pass
# close the file
f.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment