Commit 0d6b0ceb authored by Declan Snyder's avatar Declan Snyder Committed by Chris Friedt
Browse files

scripts: gen_offset_header: Fix file leak



The files should be closed after done being used, otherwise python
warnings are generated from the sys module

Signed-off-by: default avatarDeclan Snyder <declan.snyder@nxp.com>
parent 83b9577f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -77,8 +77,7 @@ if __name__ == '__main__':

    args = parser.parse_args()

    input_file = open(args.input, 'rb')
    output_file = open(args.output, 'w')

    with open(args.input, 'rb') as input_file, open(args.output, 'w') as output_file:
        ret = gen_offset_header(args.input, input_file, output_file)

    sys.exit(ret)