Fix pylint warnings in _open
authorAlexander Popov <alex.popov@linux.com>
Sun, 12 May 2024 15:21:44 +0000 (18:21 +0300)
committerAlexander Popov <alex.popov@linux.com>
Sun, 12 May 2024 15:21:44 +0000 (18:21 +0300)
kernel_hardening_checker/__init__.py

index 1522d4a87aec946af42884ef0e933e5b7aa8ae02..0e4c15263eacca4da305247311e162ad42f2bb98 100644 (file)
@@ -24,10 +24,8 @@ from .engine import populate_with_data, perform_checks, override_expected_value
 
 def _open(file: str, *args, **kwargs) -> TextIO:
     if file.endswith('.gz'):
-        f = gzip.open(file, *args, **kwargs)
-    else:
-        f = open(file, *args, **kwargs)
-    return f
+        return gzip.open(file, *args, **kwargs)
+    return open(file, *args, **kwargs)
 
 
 def detect_arch(fname: str, archs: List[str]) -> Tuple: