From 9a74beba9a6fc827482834fadbab8d2e20fa1acb Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Thu, 6 Jul 2017 13:09:20 +0200 Subject: Remove broad except The protected code only calls re.match and list.append so it should never fail (and if it still fails it should not be silenced). --- alot/addressbook/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'alot/addressbook') diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py index cda2d8bd..fbd95a99 100644 --- a/alot/addressbook/__init__.py +++ b/alot/addressbook/__init__.py @@ -36,10 +36,7 @@ class AddressBook(object): res = [] query = '.*%s.*' % query for name, email in self.get_contacts(): - try: - if re.match(query, name, self.reflags) or \ - re.match(query, email, self.reflags): - res.append((name, email)) - except: - pass + if re.match(query, name, self.reflags) or \ + re.match(query, email, self.reflags): + res.append((name, email)) return res -- cgit v1.2.3