Skip to content
Snippets Groups Projects
Commit d82ab34b authored by Patrick Godwin's avatar Patrick Godwin
Browse files

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
No related branches found
No related tags found
Loading
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment