From 1f7a548e87bb83ebe96d1856e08a9e3fd35af73d Mon Sep 17 00:00:00 2001 From: Jonathan Lestrelin Date: Sat, 2 Oct 2021 04:39:53 +0200 Subject: [PATCH] Make it so that we can import thefuzz or fuzzywuzzy depending on which one is available. --- gnome-pass-search-provider.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnome-pass-search-provider.py b/gnome-pass-search-provider.py index 4f66769..7d26dcb 100755 --- a/gnome-pass-search-provider.py +++ b/gnome-pass-search-provider.py @@ -31,8 +31,13 @@ from os.path import join as path_join import dbus.service from dbus.mainloop.glib import DBusGMainLoop -from fuzzywuzzy import fuzz -from fuzzywuzzy import process + +try: + from thefuzz import fuzz + from thefuzz import process +except ModuleNotFoundError: + from fuzzywuzzy import fuzz + from fuzzywuzzy import process from gi.repository import GLib # Convenience shorthand for declaring dbus interface methods.