jenkins-bot merged this change.

View Change

Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
[IMPR] Simplify month_delta test in apply_month_delta

Change-Id: Iff0679ff62dba9f51be604e55b0bc539fec6beaa
---
M pywikibot/date.py
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pywikibot/date.py b/pywikibot/date.py
index fb761cb..aecefd1 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -2360,7 +2360,7 @@
@return: The end date
@rtype: type of date
"""
- if int(month_delta) != month_delta:
+ if not isinstance(month_delta, int):
raise ValueError('Month delta must be an integer')
month = (date.month - 1) + month_delta
year = date.year + month // 12

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff0679ff62dba9f51be604e55b0bc539fec6beaa
Gerrit-Change-Number: 505630
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)