From 98ab9fa94f926e11a58cb0c1ccc4aaebe5a3b349 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 11 Mar 2016 16:54:39 +0800 Subject: [PATCH] MSVC builds: Update string replacement util script This makes the replace-single function make use of the replace-multi function, that was just added, to ease future maintenance. --- build/win32/replace.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/build/win32/replace.py b/build/win32/replace.py index 7c64b7343..a81bab942 100644 --- a/build/win32/replace.py +++ b/build/win32/replace.py @@ -32,11 +32,8 @@ def replace_multi(src, dest, replace_items): replace_dict[re.escape(m.group(0))], line)) def replace(src, dest, instring, outstring): - with open(src, 'r') as s: - with open(dest, 'w') as d: - for line in s: - i = line.replace(instring, outstring) - d.write(i) + replace_item = {instring: outstring} + replace_multi(src, dest, replace_item) def check_required_args(args, params): for param in params: