Skip to content

Commit 1b39377

Browse files
Use for:else: where it makes sense (#539)
Co-authored-by: zzj <29055749+zjzh@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent 4f9f5bf commit 1b39377

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

html5lib/_ihatexml.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,15 @@ def charStringToList(chars):
104104
charRanges = [item.strip() for item in chars.split(" | ")]
105105
rv = []
106106
for item in charRanges:
107-
foundMatch = False
108107
for regexp in (reChar, reCharRange):
109108
match = regexp.match(item)
110109
if match is not None:
111110
rv.append([hexToInt(item) for item in match.groups()])
112111
if len(rv[-1]) == 1:
113112
rv[-1] = rv[-1] * 2
114-
foundMatch = True
115113
break
116-
if not foundMatch:
114+
else:
117115
assert len(item) == 1
118-
119116
rv.append([ord(item)] * 2)
120117
rv = normaliseCharList(rv)
121118
return rv

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy