From 3d69aa9ce454a151ba75deafd7de117af2c7307d Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Fri, 30 Nov 2018 10:44:39 +0100 Subject: [PATCH] Fix searching for python 3.7 3.7 introduced a change to `re.escape()`, which no longer escapes `%`. By using `re.escape("%")` instead of a literal, we can detect a proper form at runtime. --- anki/find.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anki/find.py b/anki/find.py index 48d0dd1bdd2..213216d4daa 100644 --- a/anki/find.py +++ b/anki/find.py @@ -440,7 +440,7 @@ def _findField(self, field, val): # nothing has that field return # gather nids - regex = re.escape(val).replace("_", ".").replace("\\%", ".*") + regex = re.escape(val).replace("_", ".").replace(re.escape('%'), ".*") nids = [] for (id,mid,flds) in self.col.db.execute(""" select id, mid, flds from notes