jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[cleanup] Simplify date.dh_constVal function()

Change-Id: Ie8b6fb6ecc11a5d5362551b46775a8f209731734
---
M pywikibot/date.py
1 file changed, 3 insertions(+), 8 deletions(-)

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):

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

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