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
pywikibot-commits@lists.wikimedia.org