You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/11/08 00:28:06 UTC
incubator-ponymail git commit: Simplify block release by using finally
Repository: incubator-ponymail
Updated Branches:
refs/heads/master 114b52363 -> c6ff667c9
Simplify block release by using finally
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/c6ff667c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/c6ff667c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/c6ff667c
Branch: refs/heads/master
Commit: c6ff667c9dcdfd7c9dd66e9eec74234394ae3c3a
Parents: 114b523
Author: Sebb <se...@apache.org>
Authored: Tue Nov 8 00:27:57 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Tue Nov 8 00:27:57 2016 +0000
----------------------------------------------------------------------
tools/import-mbox.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/c6ff667c/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 0d66bce..1e7fac7 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -148,18 +148,19 @@ class SlurpThread(Thread):
while len(lists) > 0:
print("%u elements left to slurp" % len(lists))
+
block.acquire()
try:
mla = lists.pop(0)
+ if not mla:
+ print("Nothing more to do here")
+ return
except Exception as err:
print("Could not pop list: %s" % err)
- block.release()
return
- if not mla:
- print("Nothing more to do here")
+ finally:
block.release()
- return
- block.release()
+
EY = 1980
EM = 1
stime = time.time()