jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[IMPR] Pass exception more precise

- Pass ValueError only

Change-Id: I33b068c1807f5a25f7488848e3353cc61f807288
---
M pywikibot/date.py
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pywikibot/date.py b/pywikibot/date.py
index b2da643..0f0da40 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -60,10 +60,10 @@
for func, pred in tuplst:
try:
res = func(value)
- if pred(res):
- return res
- except Exception:
- pass
+ except ValueError:
+ continue
+ if pred(res):
+ return res
else:
# Find a predicate that gives true for this int value, and run a
# function

To view, visit change 511671. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I33b068c1807f5a25f7488848e3353cc61f807288
Gerrit-Change-Number: 511671
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)