Make lttng-gen-tp work on python 2.6
authorYannick Brosseau <yannick.brosseau@gmail.com>
Tue, 6 Mar 2012 21:11:04 +0000 (16:11 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Mar 2012 21:11:04 +0000 (16:11 -0500)
(refs #114)

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tools/lttng-gen-tp

index 3f28534858b318ae326ffeac67beb5f2febc104b..828bee6e77e72780dddbc25a5689812127353b35 100755 (executable)
@@ -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
This page took 0.024984 seconds and 4 git commands to generate.