Skip to content

Commit 0cabfbb

Browse files
author
Tom Morris
authored
Merge pull request #157 from pawelmhm/style_warnings-py.3.8.3
/dom_helpers, parser/ fix trivial style warnings
2 parents 57a19dc + 4de755d commit 0cabfbb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mf2py/dom_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def text_collection(el, replace_img=False, img_to_src=True, base_url=''):
141141

142142
return items
143143

144-
results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t is not '']
144+
results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t != '']
145145

146146
if results:
147147
# remove <space> if it is first and last or if it is preceded by a <space> or <p> open/close

mf2py/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def parse_props(el):
261261

262262
if root_class_names:
263263
parsed_types_aggregation.add('h')
264-
264+
265265
# Is this a property element (p-*, u-*, etc.) flag
266266
# False is default
267267
is_property_el = False
@@ -384,7 +384,7 @@ def parse_rels(el):
384384

385385
# 1st one wins
386386
if "text" not in value_dict:
387-
value_dict["text"] = el.get_text().strip()
387+
value_dict["text"] = el.get_text().strip()
388388

389389
url_rels = value_dict.get("rels", [])
390390
value_dict["rels"] = url_rels
@@ -411,7 +411,7 @@ def parse_rels(el):
411411
alternate_dict["url"] = url
412412
x = " ".join(
413413
[r for r in rel_attrs if not r == "alternate"])
414-
if x is not "":
414+
if x != "":
415415
alternate_dict["rel"] = x
416416
alternate_dict["text"] = text_type(el.get_text().strip())
417417
for knownattr in ("media", "hreflang", "type", "title"):

0 commit comments

Comments
 (0)