From 3124735cf17d34c9126c5f9ccc47771b1867611a Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Tue, 9 Jun 2020 16:54:44 +0200 Subject: [PATCH] Use argparse.FileType as suggested in review. --- deploy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index ba7404f..d9661c0 100755 --- a/deploy.py +++ b/deploy.py @@ -430,8 +430,7 @@ class OpenSKInstaller: ]) if self.args.elf2tab_output: output = self.checked_command_output(elf2tab_args) - with open(self.args.elf2tab_output, 'a') as f: - f.write(output) + self.args.elf2tab_output.write(output) else: self.checked_command(elf2tab_args) @@ -869,6 +868,7 @@ if __name__ == "__main__": main_parser.add_argument( "--elf2tab-output", metavar="FILE", + type=argparse.FileType("a"), dest="elf2tab_output", default=None, help=("When set, the output of elf2tab is appended to this file."),