jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/511671 )
Change subject: [IMPR] Pass exception more precise ......................................................................
[IMPR] Pass exception more precise
- Pass ValueError only
Change-Id: I33b068c1807f5a25f7488848e3353cc61f807288 --- M pywikibot/date.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
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
pywikibot-commits@lists.wikimedia.org