jenkins-bot merged this change.
[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.