jenkins-bot has submitted this change and it was merged.

Change subject: [FIX] Stop crashing item loads due to support of units
......................................................................


[FIX] Stop crashing item loads due to support of units

We need more patches to have better support of quantities with unit
But this needs to be merged ASAP, it crashes loading of every item with
claims with units in them (more than 10K items)

Bug: T112130
Change-Id: Iff7c9ad0e9cd2ec728595f900279e82848d9a0de
---
M pywikibot/__init__.py
M tests/wikibase_tests.py
2 files changed, 0 insertions(+), 5 deletions(-)

Approvals:
  XZise: Looks good to me, approved
  Multichill: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 51f456b..293aa55 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -476,9 +476,6 @@
         """
         if amount is None:
             raise ValueError('no amount given')
-        if unit is not None and unit != '1':
-            raise NotImplementedError(
-                'Currently only unit-less quantities are supported')
         if unit is None:
             unit = '1'
         self.amount = amount
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 9521f0e..5f37a54 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -184,8 +184,6 @@
         # test WbQuantity error handling
         self.assertRaises(ValueError, pywikibot.WbQuantity, amount=None,
                           error=1)
-        self.assertRaises(NotImplementedError, pywikibot.WbQuantity, 
amount=789,
-                          unit='invalid_unit')
 
 
 class TestItemPageExtensibility(TestCase):

-- 
To view, visit https://gerrit.wikimedia.org/r/237475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff7c9ad0e9cd2ec728595f900279e82848d9a0de
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Multichill <maar...@mdammers.nl>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to