Bump pre-commit flake8 to 6.1.0 19/109619/3
authorSangwook Ha <sangwook.ha@verizon.com>
Thu, 4 Jan 2024 01:50:56 +0000 (17:50 -0800)
committerSangwook Ha <sangwook.ha@verizon.com>
Sun, 7 Jan 2024 06:08:20 +0000 (06:08 +0000)
Adopt the latest version of flake8, 6.1.0, and fix the issues detected
by the new version.

Change-Id: Iadaea2b02d80fe0cefb6322694f1988708b5daed
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
.pre-commit-config.yaml
csit/libraries/ScaleClient.py
tools/distchanges/gerritquery.py

index d688a1e9ee0791367d57841a30b95068b42572fe..8e04d91d60aaf2b5f53e23dfb97a99565cc1d837 100644 (file)
@@ -9,7 +9,7 @@ repos:
         exclude: '\.robot'
 
   - repo: https://github.com/PyCQA/flake8
-    rev: 4.0.1
+    rev: 6.1.0
     hooks:
       - id: flake8
 
index 10406ba55d58fba39d71487ecbb0aa6948a19d46..74696e6f28f254192e91fc1ac30d0664b59d98f4 100644 (file)
@@ -417,7 +417,7 @@ def _wt_request_sender(
         else:
             if rsp.status_code not in [200, 201, 204]:
                 print(
-                    f"*WARN* [{req_no}] Status code {rsp.status_code}:"
+                    f"*WARN* [{req_no}] Status code {rsp.status_code}: "
                     f" {req.method} {req.url}\n{rsp.text}"
                 )
                 num_errors += 1
index 0dc09d5702dbda077658be1d5cb5836e01faa597..215f3b5e0b2d855437db49a9add6ead468440ed7 100644 (file)
@@ -78,7 +78,8 @@ class GerritQuery:
     @staticmethod
     def print_safe_encoding(string):
         try:
-            if type(string) == unicode:
+            # FIXME: Python3 does not have 'unicode'
+            if isinstance(string, unicode):
                 encoding = "utf-8"
                 if hasattr(sys.stdout, "encoding") and sys.stdout.encoding:
                     encoding = sys.stdout.encoding