[lttng-dev] [UST PATCH] Make lttng-gen-tp work on python 2.6
Yannick Brosseau
yannick.brosseau at gmail.com
Tue Mar 6 16:05:20 EST 2012
(refs #114)
Signed-off-by: Yannick Brosseau <yannick.brosseau at gmail.com>
---
tools/lttng-gen-tp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp
index 3f28534..828bee6 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
--
1.7.9.1
More information about the lttng-dev
mailing list