]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Do not use `type` as a variable name
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sun, 26 Sep 2021 13:15:36 +0000 (15:15 +0200)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 26 Feb 2022 15:51:04 +0000 (16:51 +0100)
This fixes a DeepSource alert:

Re-definition found for builtin function

Defining a local variable or function with the same name as a built-in
object makes the built-in object unusable within the current scope and
makes the code prone to bugs.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
trojans/tncc-emulate.py

index dcbbc30590f0cef1abcaab12307b439c4ce8542f..7a876a42153d6be98bf1a6e6170f8c46690112c3 100755 (executable)
@@ -277,9 +277,9 @@ class x509cert:
         ret = dict()
         for name in names.chosen:
             for attr in name:
-                type = attr['type'].dotted    # dotted-quad value (e.g. '2.5.4.10' = organization)
-                value = attr['value'].native  # literal string value (e.g. 'Bigcorp Inc.')
-                ret.setdefault(type, []).append(value)
+                type_dotted = attr['type'].dotted    # dotted-quad value (e.g. '2.5.4.10' = organization)
+                value_native = attr['value'].native  # literal string value (e.g. 'Bigcorp Inc.')
+                ret.setdefault(type_dotted, []).append(value_native)
         return ret
 
     def __init__(self, cert_file):