From c233fe111bc72058f209cd86a7b0807c3a123dfb Mon Sep 17 00:00:00 2001 From: Yannick Brosseau Date: Tue, 6 Mar 2012 16:11:04 -0500 Subject: [PATCH] Make lttng-gen-tp work on python 2.6 (refs #114) Signed-off-by: Yannick Brosseau Signed-off-by: Mathieu Desnoyers --- tools/lttng-gen-tp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp index 3f285348..828bee6e 100755 --- a/tools/lttng-gen-tp +++ b/tools/lttng-gen-tp @@ -158,9 +158,11 @@ class TemplateFile: self.text = f.read() #Remove # comments (from input and output file - self.text = re.sub("#.*$","",self.text,flags=re.MULTILINE) + removeComments = re.compile("#.*$",flags=re.MULTILINE) + self.text = removeComments.sub("",self.text) #Remove // comments - nolinecomment = re.sub("\/\/.*$","",self.text,flags=re.MULTILINE) + removeLineComment = re.compile("\/\/.*$",flags=re.MULTILINE) + nolinecomment = removeLineComment.sub("",self.text) #Remove all spaces and lines cleantext = re.sub("\s*","",nolinecomment) #Remove multine C style comments -- 2.34.1