ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [incubator-ponymail] branch master updated: pylint: narrow catch
Date Mon, 21 May 2018 00:13:50 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 449dcbf  pylint: narrow catch
449dcbf is described below

commit 449dcbfdf7af66109b7465386e20392a2c3d7b8f
Author: Sebb <sebb@apache.org>
AuthorDate: Mon May 21 01:13:48 2018 +0100

    pylint: narrow catch
---
 tools/copy-list.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/copy-list.py b/tools/copy-list.py
index 698afe0..e81b4b8 100755
--- a/tools/copy-list.py
+++ b/tools/copy-list.py
@@ -29,8 +29,8 @@ import configparser
 import argparse
 
 try:
-    from elasticsearch import Elasticsearch, helpers
-except:
+    from elasticsearch import Elasticsearch, helpers, ElasticsearchException
+except ImportError:
     print("Sorry, you need to install the elasticsearch and formatflowed modules from pip
first.")
     sys.exit(-1)
     
@@ -153,7 +153,7 @@ while (scroll_size > 0):
         source = None
         try:
             source = es.get(index = dbname, doc_type = 'mbox_source', id = doc)
-        except:
+        except ElasticsearchException:
             print("Source for %s not found, hmm..." % doc)
         if targetLID != sourceLID:
             doc = hit['_id'].replace(sourceLID,targetLID)

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.

Mime
View raw message