From 871b6cc83973690675f927fdb535526d8a15ec13 Mon Sep 17 00:00:00 2001 From: acmello Date: Thu, 1 Jul 2021 17:17:06 +0200 Subject: [PATCH] Removed unnecessary with clause --- parser/linpeas-parser.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/parser/linpeas-parser.py b/parser/linpeas-parser.py index b117d13..e294a3d 100755 --- a/parser/linpeas-parser.py +++ b/parser/linpeas-parser.py @@ -105,9 +105,8 @@ def read_file(output_path: str) -> [str]: Reads file from a specich path and returns it as a list """ - with open(output_path, 'r') as file: - return [row.strip() for row in file.readlines() if row] - + return [row.strip() for row in open(output_path, 'r').readlines() if row] + def is_starting_section( row: str, pattern: str = MAIN_section_PATTERN @@ -237,4 +236,3 @@ def main(): if __name__ == "__main__": # execute only if run as a script main() - \ No newline at end of file