From: batt Date: Tue, 27 Apr 2010 16:57:38 +0000 (+0000) Subject: Avoid recursion on string.replace() X-Git-Tag: 2.5.0~355 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=18205937fe68f9513e43875fc8f39f2711b8d2c7;p=bertos.git Avoid recursion on string.replace() git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3553 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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):