[mythtv-users] minor syntax warning (was: Important: Changes to Metadata lookup in March 2021)

lists at arewethere.net lists at arewethere.net
Tue Feb 23 12:17:52 UTC 2021


Just upgraded and during installation of
  libmyth-python (2:31.0+fixes.202102201954.525e3b0bb4~ubuntu20.04.1)

I saw this flash past:

/usr/lib/python3/dist-packages/MythTV/tvmaze/utils.py:45: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if html is not None and html is not "":

I think what it's asking for is (fixes/0.31):

diff --git a/mythtv/bindings/python/tvmaze/utils.py b/mythtv/bindings/python/tvmaze/utils.py
index e89896be60..521d25ed42 100644
--- a/mythtv/bindings/python/tvmaze/utils.py
+++ b/mythtv/bindings/python/tvmaze/utils.py
@@ -42,7 +42,7 @@ else:


 def strip_tags(html):
-    if html is not None and html is not "":
+    if html is not None and html != "":
         s = MLStripper()
         s.feed(html)
         return s.get_data()

but my python is weak.
Cheers


More information about the mythtv-users mailing list