Lokal Profil has uploaded a new change for review. ( 
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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/39/339939/1

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: newchange
Gerrit-Change-Id: Icf05b0e3fa0d3767ef8577c0a9abc42602f8b4c1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <lokal.pro...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to