diff options
author | Fred Drake <fdrake@acm.org> | 2001-05-09 04:03:16 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-05-09 04:03:16 (GMT) |
commit | af922187ae05e244b33b6b95b1898abd7f208a79 (patch) | |
tree | a21a769a54e7713ea0d3fd040d570a39499dfbee /Doc | |
parent | a7c9ac6544fc9669109793e5e506530e0e738970 (diff) | |
download | cpython-af922187ae05e244b33b6b95b1898abd7f208a79.zip cpython-af922187ae05e244b33b6b95b1898abd7f208a79.tar.gz cpython-af922187ae05e244b33b6b95b1898abd7f208a79.tar.bz2 |
Job.build_html(): Be more robust in ensuring about.html exists; copying
the right HTML file to the name about.html is needed even if the
--numeric option was not given -- some other name may have been
assigned due to some non-determinism in the algorithm use to perform
name allocation. ;-(
This closes the "About..." portion of SF bug #420216.
Diffstat (limited to 'Doc')
-rwxr-xr-x | Doc/tools/mkhowto | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto index f11eec1..6481e93 100755 --- a/Doc/tools/mkhowto +++ b/Doc/tools/mkhowto @@ -369,24 +369,23 @@ class Job: shutil.copyfile(os.path.join(builddir, self.doc + ".html"), os.path.join(builddir, "index.html")) if max_split_depth != 1: - if self.options.numeric: - label_file = os.path.join(builddir, "labels.pl") - fp = open(label_file) - about_node = None - target = " = q/about/;\n" - x = len(target) - while 1: + label_file = os.path.join(builddir, "labels.pl") + fp = open(label_file) + about_node = None + target = " = q/about/;\n" + x = len(target) + while 1: + line = fp.readline() + if not line: + break + if line[-x:] == target: line = fp.readline() - if not line: - break - if line[-x:] == target: - line = fp.readline() - m = re.search(r"\|(node\d+\.[a-z]+)\|", line) - about_node = m.group(1) - shutil.copyfile(os.path.join(builddir, about_node), - os.path.join(builddir, "about.html")) - break - else: + m = re.search(r"\|(node\d+\.[a-z]+)\|", line) + about_node = m.group(1) + shutil.copyfile(os.path.join(builddir, about_node), + os.path.join(builddir, "about.html")) + break + if not self.options.numeric: pwd = os.getcwd() try: os.chdir(builddir) |