Skip to content

Commit f46f893

Browse files
committed
Don't try to output draft metadata (in standalone mode) for a file if the extraction failed.
- Legacy-Id: 3505
1 parent 8a55193 commit f46f893

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/utils/draft.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def getmeta(fn):
770770
filename = os.path.join("/www/tools.ietf.org/id", fn)
771771
if not os.path.exists(filename):
772772
_warn("Could not find file: '%s'" % (filename))
773-
return
773+
return None
774774

775775
timestamp = time.strftime("%Y-%m-%dT%H:%M:%S+00:00", time.gmtime(os.stat(filename)[stat.ST_MTIME]))
776776
text = _gettext(filename)
@@ -822,7 +822,8 @@ def _printmeta(timestamp, fn, outfile=sys.stdout):
822822
sys.stderr.write("%-58s" % fn[:-4])
823823

824824
fields = getmeta(fn)
825-
_output(fields.get("doctag", fn[:-7]), fields, outfile)
825+
if fields:
826+
_output(fields.get("doctag", fn[:-7]), fields, outfile)
826827

827828
if opt_trace:
828829
sys.stderr.write("%5.1f\n" % ((time.time() - t)))

0 commit comments

Comments
 (0)