Mercurial > p > roundup > code
comparison roundup/cgi/TAL/HTMLParser.py @ 5265:63868084b8bb
Python 2 and 3 support. Convert Exception to BaseException. TAL and
PageTemplate code.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 04 Sep 2017 21:58:16 -0400 |
| parents | 8c2402a78bb0 |
| children | 12fe83f90f0d |
comparison
equal
deleted
inserted
replaced
| 5264:32f95ec6bd8e | 5265:63868084b8bb |
|---|---|
| 45 """, re.VERBOSE) | 45 """, re.VERBOSE) |
| 46 endendtag = re.compile('>') | 46 endendtag = re.compile('>') |
| 47 endtagfind = re.compile('</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>') | 47 endtagfind = re.compile('</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>') |
| 48 | 48 |
| 49 | 49 |
| 50 class HTMLParseError(Exception): | 50 class HTMLParseError(BaseException): |
| 51 """Exception raised for all parse errors.""" | 51 """Exception raised for all parse errors.""" |
| 52 | 52 |
| 53 def __init__(self, msg, position=(None, None)): | 53 def __init__(self, msg, position=(None, None)): |
| 54 assert msg | 54 assert msg |
| 55 self.msg = msg | 55 self.msg = msg |
