diff options
author | Mats Wichmann <mats@linux.com> | 2020-07-04 14:30:25 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-07-04 14:30:25 (GMT) |
commit | c16d44ca42227fe1033e73daf26b07888444fee8 (patch) | |
tree | d15f0fe604e34c49031e469899ed9c2e8a5b90d2 /bin/scons-proc.py | |
parent | d1184b576d1304395bed12a25312c77ef6554b03 (diff) | |
download | SCons-c16d44ca42227fe1033e73daf26b07888444fee8.zip SCons-c16d44ca42227fe1033e73daf26b07888444fee8.tar.gz SCons-c16d44ca42227fe1033e73daf26b07888444fee8.tar.bz2 |
Update doc gen to fail more definitively [skip appveyor]
Now the scons "product" build (including generating and
building docs) is done in CI, it's useful to fail more
distinctly on xml problems. Modify scripts to do that,
and do a bit of reformatting along the way.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'bin/scons-proc.py')
-rw-r--r-- | bin/scons-proc.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py index fb9e6df..799b12a 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -61,9 +61,10 @@ def parse_docs(args, include_entities=True): if include_entities: try: h.parseXmlFile(f) - except: - sys.stderr.write("error in %s\n" % f) - raise + except Exception as e: + print("error parsing %s\n" % f, file=sys.stderr) + print(str(e), file=sys.stderr) + sys.exit(1) else: # mode we read (text/bytes) has to match handling in SConsDoc with open(f, 'r') as fp: @@ -71,9 +72,10 @@ def parse_docs(args, include_entities=True): if content: try: h.parseContent(content, include_entities) - except: - sys.stderr.write("error in %s\n" % f) - raise + except Exception as e: + print("error parsing %s\n" % f, file=sys.stderr) + print(str(e), file=sys.stderr) + sys.exit(1) return h Warning = """\ @@ -408,6 +410,7 @@ if SConsDoc.validate_all_xml(['SCons']): print("OK") else: print("Validation failed! Please correct the errors above and try again.") + sys.exit(1) # Step 3: Creating actual documentation snippets, using the # fully resolved and updated entities from the *.mod files. |