Skip to contentSkip to conversation

buildstats: Replace 'is' with '==' in python condition check expression

PATCH New Khem Raj 1 participant 1 message Dec 8, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 buildstats: Replace 'is' with '==' in python condition check expression

python 3.8 has started to throw this as a warning but usage is wrong see [1], it seems to be working by accident and not design.

Fixes
SyntaxWarning: "is" with a literal. Did you mean "=="?

[1]: https://bugs.python.org/issue34850

---
 meta/classes/buildstats.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/buildstats.bbclass +1 -1
index 960653c704..2590c60c63 100644
@@ -100,7 +100,7 @@ def write_task_data(status, logfile, e, d):
                 f.write("rusage %s: %s\n" % (i, getattr(resources, i)))
             for i in rusages:
                 f.write("Child rusage %s: %s\n" % (i, getattr(childres, i)))
-        if status is "passed":
+        if status == "passed":
             f.write("Status: PASSED \n")
         else:
             f.write("Status: FAILED \n")
Signature · 1 line
2.24.0