diff --git a/rope/contrib/autoimport/models.py b/rope/contrib/autoimport/models.py index f56990cf6..817a51ae7 100644 --- a/rope/contrib/autoimport/models.py +++ b/rope/contrib/autoimport/models.py @@ -111,6 +111,7 @@ def create_table(cls, connection): search_by_name_like = objects.where("name LIKE (?)") + search_by_name = objects.where("name IS (?)") delete_by_module_name = objects.where("module = ?").delete_from() diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py index 507352782..eb7c27ded 100644 --- a/rope/contrib/autoimport/sqlite.py +++ b/rope/contrib/autoimport/sqlite.py @@ -297,7 +297,7 @@ def _search_module( def get_modules(self, name) -> List[str]: """Get the list of modules that have global `name`.""" results = self._execute( - models.Name.search_by_name_like.select("module", "source"), (name,) + models.Name.search_by_name.select("module", "source"), (name,) ).fetchall() return sort_and_deduplicate(results)