File: 01_fix_SyntaxWarning.patch

package info (click to toggle)
mf2py 1.1.2-2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 744 kB
  • sloc: python: 2,015; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 975 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/mf2py/dom_helpers.py
+++ b/mf2py/dom_helpers.py
@@ -141,7 +141,7 @@ def get_textContent(el, replace_img=Fals
 
         return items
 
-    results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t is not '']
+    results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t != '']
 
     if results:
         # remove <space> if it is first and last or if it is preceded by a <space> or <p> open/close
--- a/mf2py/parser.py
+++ b/mf2py/parser.py
@@ -406,7 +406,7 @@ class Parser(object):
                     alternate_dict["url"] = url
                     x = " ".join(
                         [r for r in rel_attrs if not r == "alternate"])
-                    if x is not "":
+                    if x != "":
                         alternate_dict["rel"] = x
                     alternate_dict["text"] = text_type(el.get_text().strip())
                     for knownattr in ("media", "hreflang", "type", "title"):