From: Alexander Popov Date: Sun, 12 May 2024 15:21:44 +0000 (+0300) Subject: Fix pylint warnings in _open X-Git-Tag: v0.6.10~67^2~20 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=3748c73af62c1eb95c33fc6a2072e158425d4316;p=kconfig-hardened-check.git Fix pylint warnings in _open --- 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: