diff --git a/html5lib/_ihatexml.py b/html5lib/_ihatexml.py index 3ff803c1..d725eabd 100644 --- a/html5lib/_ihatexml.py +++ b/html5lib/_ihatexml.py @@ -104,18 +104,15 @@ def charStringToList(chars): charRanges = [item.strip() for item in chars.split(" | ")] rv = [] for item in charRanges: - foundMatch = False for regexp in (reChar, reCharRange): match = regexp.match(item) if match is not None: rv.append([hexToInt(item) for item in match.groups()]) if len(rv[-1]) == 1: rv[-1] = rv[-1] * 2 - foundMatch = True break - if not foundMatch: + else: assert len(item) == 1 - rv.append([ord(item)] * 2) rv = normaliseCharList(rv) return rv