Mercurial > hgbook
diff en/examples/run-example @ 155:914babdc99c8
run-example: better error if bogus section name found.
Fix all such bogus names in sources.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 12 Mar 2007 23:10:32 -0700 |
parents | e7f48702d409 |
children | 745ff473c8c4 |
line wrap: on
line diff
--- a/en/examples/run-example Mon Mar 12 22:56:29 2007 -0700 +++ b/en/examples/run-example Mon Mar 12 23:10:32 2007 -0700 @@ -203,7 +203,11 @@ if pi == 'name': self.status('.') out = rest - assert out not in ('err', 'lxo', 'out', 'run', 'tmp') + if out in ('err', 'lxo', 'out', 'run', 'tmp'): + print >> sys.stderr, ('%s: illegal section ' + 'name %r' % + (self.name, out)) + return 1 assert os.sep not in out if ofp is not None: ofp.close()