Skip to content

Commit ae6520f

Browse files
committed
Removed print() from library code and 3to2 leftovers
1 parent e674941 commit ae6520f

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

html5lib/ihatexml.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ def escapeRegexp(string):
171171
"[", "]", "|", "(", ")", "-")
172172
for char in specialCharacters:
173173
string = string.replace(char, "\\" + char)
174-
if char in string:
175-
print(string)
176174

177175
return string
178176

html5lib/serializer/htmlserializer.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
try:
88
from functools import reduce
9-
pass # no-op statement to avoid 3to2 introducing parse error
109
except ImportError:
1110
pass
1211

@@ -35,11 +34,7 @@
3534
if len(v) == 2:
3635
v = utils.surrogatePairToCodepoint(v)
3736
else:
38-
try:
39-
v = ord(v)
40-
except:
41-
print(v)
42-
raise
37+
v = ord(v)
4338
if not v in encode_entity_map or k.islower():
4439
# prefer < over < and similarly for &, >, etc.
4540
encode_entity_map[v] = k

html5lib/treebuilders/etree_lxml.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,7 @@ def insertRoot(self, token):
323323
if self.doctype.name != token["name"]:
324324
warnings.warn("lxml cannot represent doctype with a different name to the root element", DataLossWarning)
325325
docStr += "<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>"
326-
327-
try:
328-
root = etree.fromstring(docStr)
329-
except etree.XMLSyntaxError:
330-
print(docStr)
331-
raise
326+
root = etree.fromstring(docStr)
332327

333328
# Append the initial comments:
334329
for comment_token in self.initial_comments:

0 commit comments

Comments
 (0)