]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix 'testing equality to None' python issue 14513/head
authorluz paz <luzpaz@pm.me>
Thu, 1 Dec 2022 14:18:15 +0000 (09:18 -0500)
committerluz paz <luzpaz@pm.me>
Thu, 1 Dec 2022 14:18:15 +0000 (09:18 -0500)
"Testing whether an object is '`None`' using the `==` operator is inefficient and potentially incorrect."

contrib/utilities/parse_ctest_output.py

index fd034c29d4c64453fe672ed7845ff7dd5f6b7e2c..a11bce618a802bf1dd993b739b11596b43a601ee 100644 (file)
@@ -77,7 +77,7 @@ def parse_revision(dirname):
         status = 4
         if fail:
             text = test.find('Results').find('Measurement').find('Value').text
-            if text == None:
+            if text is None:
                 text=""
             failtext = text.encode('utf-8')
             failtextlines = failtext.replace('"','').split('\n')

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.