From: Yannick Brosseau Date: Tue, 6 Mar 2012 21:11:04 +0000 (-0500) Subject: Make lttng-gen-tp work on python 2.6 X-Git-Tag: v2.0.0-rc3~11 X-Git-Url: https://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=c233fe111bc72058f209cd86a7b0807c3a123dfb Make lttng-gen-tp work on python 2.6 (refs #114) Signed-off-by: Yannick Brosseau Signed-off-by: Mathieu Desnoyers --- 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