Minor update

This commit is contained in:
Miroslav Stampar
2019-03-11 15:25:16 +01:00
parent c7bb44b0a2
commit 662a3c3d6f
4 changed files with 7 additions and 7 deletions

View File

@@ -559,7 +559,7 @@ class Tag(PageElement):
self.escapeUnrecognizedEntities = parser.escapeUnrecognizedEntities
# Convert any HTML, XML, or numeric entities in the attribute values.
convert = lambda(k, val): (k,
convert = lambda k, val: (k,
re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);",
self._convertEntities,
val))
@@ -1828,7 +1828,7 @@ class UnicodeDammit:
"iso-8859-1",
"iso-8859-2"):
markup = re.compile("([\x80-\x9f])").sub \
(lambda(x): self._subMSChar(x.group(1)),
(lambda x: self._subMSChar(x.group(1)),
markup)
try:

View File

@@ -290,7 +290,7 @@ def isstringlike(x):
def choose_boundary():
"""Return a string usable as a multipart boundary."""
# follow IE and firefox
nonce = "".join([str(random.randint(0, sys.maxint-1)) for i in 0,1,2])
nonce = "".join([str(random.randint(0, sys.maxint-1)) for i in (0,1,2)])
return "-"*27 + nonce
# This cut-n-pasted MimeWriter from standard library is here so can add