Bump Flake8 to fix CI for Python 3.7 (#554) · openSUSE-Python/html5lib-python@3ecbda6 · GitHub
Skip to content

Commit 3ecbda6

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

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

html5lib/_inputstream.py

Lines changed: 1 addition & 1 deletion

html5lib/serializer.py

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)