From 78c818e4c9e8b126bd071b871367aaf8b42eca6e Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Wed, 3 Jan 2018 15:35:25 -0500 Subject: [PATCH] =?UTF-8?q?for/write=20=E2=86=92=20writelines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/sort_map.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/sort_map.py b/tools/sort_map.py index dedeb3fd1..a5202e8e6 100644 --- a/tools/sort_map.py +++ b/tools/sort_map.py @@ -25,7 +25,7 @@ def total_bank_size(type): } return sizes[type] -def sorted_mapfile(input): +def map_to_sym(input): # analogous to ";File generated by rgblink" yield ';File generated by sort_map.py\n' @@ -117,10 +117,9 @@ def main(): output_filename = sys.argv[2] with open(input_filename, 'r') as infile: input = infile.readlines() - output = sorted_mapfile(input) + output = map_to_sym(input) with open(output_filename, 'w') as outfile: - for line in output: - outfile.write(line) + outfile.writelines(output) if __name__ == '__main__': main()