perf tools: Address python 3.6 DeprecationWarning for string scapes
[linux-2.6-microblaze.git] / tools / perf / scripts / python / exported-sql-viewer.py
index 13f2d8a..121cf61 100755 (executable)
@@ -677,8 +677,8 @@ class CallGraphModelBase(TreeModel):
                        #   sqlite supports GLOB (text only) which uses * and ? and is case sensitive
                        if not self.glb.dbref.is_sqlite3:
                                # Escape % and _
-                               s = value.replace("%", "\%")
-                               s = s.replace("_", "\_")
+                               s = value.replace("%", "\\%")
+                               s = s.replace("_", "\\_")
                                # Translate * and ? into SQL LIKE pattern characters % and _
                                trans = string.maketrans("*?", "%_")
                                match = " LIKE '" + str(s).translate(trans) + "'"