From 3748c73af62c1eb95c33fc6a2072e158425d4316 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 12 May 2024 18:21:44 +0300 Subject: [PATCH] Fix pylint warnings in _open --- kernel_hardening_checker/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index 1522d4a..0e4c152 100644 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -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: -- 2.31.1