]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tools: pylint dump-auxv.py
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 9 Aug 2023 19:53:45 +0000 (21:53 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 10 Aug 2023 16:13:29 +0000 (18:13 +0200)
tools/dump-auxv.py

index 36f3b37bf42f7bbffe85b28a98857b8664e2de3c..d6dbcb1f0756f22841af36d55e32f4ca6bcd389b 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/python
 # SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# Note: the no-value-for-parameter here is expected, as the click module
+#       decorators modify function arguments which pylint doesn't know
+# pylint: disable=no-value-for-parameter
 
 """
 A program to parse auxv (e.g. /proc/self/auxv).
@@ -109,12 +113,12 @@ def dump(endian, field_width, file):
 
     width = {32:'II', 64:'QQ'}[field_width]
 
-    format = f'{endian}{width}'
-    print(f'# {format=}')
+    format_str = f'{endian}{width}'
+    print(f'# {format_str=}')
 
     seen_null = False
 
-    for item in struct.iter_unpack(format, data):
+    for item in struct.iter_unpack(format_str, data):
         key, val = item
         name = AT_AUXV_NAMES.get(key, f'unknown ({key})')
         if name.endswith(('UID', 'GID')):
@@ -123,7 +127,7 @@ def dump(endian, field_width, file):
             pref, fmt = '0x', 'x'
 
         if seen_null:
-            print('# trailing garbarbage after AT_NULL')
+            print('# trailing garbage after AT_NULL')
 
         print(f'{name:18} = {pref}{val:{fmt}}')