From 18205937fe68f9513e43875fc8f39f2711b8d2c7 Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 27 Apr 2010 16:57:38 +0000 Subject: [PATCH] Avoid recursion on string.replace() git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3553 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 6afc8db2..7c05a17c 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -149,9 +149,7 @@ def userMkGeneratorFromPreset(project_info): destination = os.path.join(project_info.prjdir, "%s_user.mk" %project_info.info("PROJECT_NAME")) # Temporary code. # TODO: write it using regular expressions to secure this function - if preset_name != project_name: - while makefile.find(preset_name + "_") != -1: - makefile = makefile.replace(preset_name + "_", project_name + "_") + makefile = makefile.replace(preset_name + "_", project_name + "_") open(destination, "w").write(makefile) def userMkGenerator(project_info): -- 2.25.1