Przeglądaj źródła

Comparison with None performed with equality operators. (#3815)

* Comparison with None performed with equality operators.

* Update metadata.py

* Update results.py
Matheus Rocha Vieira 7 lat temu
rodzic
commit
78d012560c

+ 1 - 1
toolset/utils/benchmark_config.py

@@ -82,7 +82,7 @@ class BenchmarkConfig:
         self.wrk_root = os.path.join(self.fw_root, "toolset", "wrk")
         self.scaffold_root = os.path.join(self.fw_root, "toolset", "scaffolding")
 
-        if hasattr(self, 'parse') and self.parse != None:
+        if hasattr(self, 'parse') and self.parse is not None:
             self.timestamp = self.parse
         else:
             self.timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime())

+ 1 - 1
toolset/utils/metadata.py

@@ -404,7 +404,7 @@ class Metadata:
             "plaintext_url", "cached_query_url"
         ]:
             key_value = test_keys.get(test_url, None)
-            if key_value != None and not key_value.startswith('/'):
+            if key_value is not None and not key_value.startswith('/'):
                 errmsg = """`%s` field in test \"%s\" does not appear to be a valid url: \"%s\"\n
             Example `%s` url: \"%s\"
           """ % (test_url, test_name, key_value, test_url, example_urls[test_url])

+ 1 - 1
toolset/utils/results.py

@@ -200,7 +200,7 @@ class Results:
         '''
         Attempts to upload the results.json to the configured results_upload_uri
         '''
-        if self.config.results_upload_uri != None:
+        if self.config.results_upload_uri is not None:
             try:
                 requests.post(
                     self.config.results_upload_uri,