jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/339939 )
Change subject: [Bug]Recognize zero as a valid error bound
......................................................................
[Bug]Recognize zero as a valid error bound
Providing zero for either of the bound would trigger the
_require_errors test.
Changing from "if bound" to "if bound is not None" type tests
allows zero to be recognized a a valid bound.
Change-Id: Icf05b0e3fa0d3767ef8577c0a9abc42602f8b4c1
---
M pywikibot/__init__.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index b980330..f9782ce 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -731,8 +731,9 @@
amount = cls._todecimal(wb['amount'])
upperBound = cls._todecimal(wb.get('upperBound'))
lowerBound = cls._todecimal(wb.get('lowerBound'))
+ bounds_provided = (upperBound is not None and lowerBound is not None)
error = None
- if (upperBound and lowerBound) or cls._require_errors(site):
+ if bounds_provided or cls._require_errors(site):
error = (upperBound - amount, amount - lowerBound)
if wb['unit'] == '1':
unit = None
--
To view, visit https://gerrit.wikimedia.org/r/339939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf05b0e3fa0d3767ef8577c0a9abc42602f8b4c1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>