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):
--
To view, visit
https://gerrit.wikimedia.org/r/510694
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/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(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)