jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510694 )
Change subject: [cleanup] Simplify date.dh_constVal function() ......................................................................
[cleanup] Simplify date.dh_constVal function()
Change-Id: Ie8b6fb6ecc11a5d5362551b46775a8f209731734 --- M pywikibot/date.py 1 file changed, 3 insertions(+), 8 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py index 4f79f38..b2da643 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -226,18 +226,13 @@
formats['CurrEvents']['en'](ind) => 'Current Events' formats['CurrEvents']['en']('Current Events') => ind - """ if isinstance(value, UnicodeType): if value == match: return ind - else: - raise ValueError() - else: - if value == ind: - return match - else: - raise ValueError('unknown value %d' % value) + elif value == ind: + return match + raise ValueError('unknown value {}'.format(value))
def alwaysTrue(x):
pywikibot-commits@lists.wikimedia.org