Skip to content

Commit 3ecbda6

Browse files
authored
Bump Flake8 to fix CI for Python 3.7 (#554)
1 parent f7cab6f commit 3ecbda6

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

html5lib/_inputstream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def charsUntil(self, characters, opposite=False):
324324
except KeyError:
325325
if __debug__:
326326
for c in characters:
327-
assert(ord(c) < 128)
327+
assert ord(c) < 128
328328
regex = "".join(["\\x%02x" % ord(c) for c in characters])
329329
if not opposite:
330330
regex = "^%s" % regex

html5lib/serializer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ def __init__(self, **kwargs):
222222
self.strict = False
223223

224224
def encode(self, string):
225-
assert(isinstance(string, text_type))
225+
assert isinstance(string, text_type)
226226
if self.encoding:
227227
return string.encode(self.encoding, "htmlentityreplace")
228228
else:
229229
return string
230230

231231
def encodeStrict(self, string):
232-
assert(isinstance(string, text_type))
232+
assert isinstance(string, text_type)
233233
if self.encoding:
234234
return string.encode(self.encoding, "strict")
235235
else:

html5lib/tests/test_serializer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _convertAttrib(self, attribs):
7474
attrs = {}
7575
for attrib in attribs:
7676
name = (attrib["namespace"], attrib["name"])
77-
assert(name not in attrs)
77+
assert name not in attrs
7878
attrs[name] = attrib["value"]
7979
return attrs
8080

html5lib/treebuilders/etree.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def removeChild(self, node):
108108
node.parent = None
109109

110110
def insertText(self, data, insertBefore=None):
111-
if not(len(self._element)):
111+
if not len(self._element):
112112
if not self._element.text:
113113
self._element.text = ""
114114
self._element.text += data
@@ -201,7 +201,7 @@ def testSerializer(element):
201201
rv = []
202202

203203
def serializeElement(element, indent=0):
204-
if not(hasattr(element, "tag")):
204+
if not hasattr(element, "tag"):
205205
element = element.getroot()
206206
if element.tag == "<!DOCTYPE>":
207207
if element.get("publicId") or element.get("systemId"):

html5lib/treewalkers/etree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def getNodeDetails(self, node):
3737
else:
3838
node = elt
3939

40-
if not(hasattr(node, "tag")):
40+
if not hasattr(node, "tag"):
4141
node = node.getroot()
4242

4343
if node.tag in ("DOCUMENT_ROOT", "DOCUMENT_FRAGMENT"):

requirements-test.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r requirements.txt
22

33
tox>=3.15.1,<4
4-
flake8>=3.8.1,<3.9
4+
flake8>=3.8.1,<6
55
pytest>=4.6.10,<5 ; python_version < '3'
66
pytest>=5.4.2,<7 ; python_version >= '3'
77
coverage>=5.1,<6

0 commit comments

Comments
 (0)