mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-29 23:06:39 +08:00
BUG: Handle OverflowError by comparing False
instead of raising
This commit is contained in:
@@ -232,6 +232,8 @@ class AssetTestCase(TestCase):
|
||||
self.assertNotEqual(s_23, 23.5)
|
||||
self.assertNotEqual(s_23, [])
|
||||
self.assertNotEqual(s_23, None)
|
||||
# Compare to a value that doesn't fit into a platform int:
|
||||
self.assertNotEqual(s_23, sys.maxsize + 1)
|
||||
|
||||
self.assertLess(s_23, s_24)
|
||||
self.assertLess(s_23, 24)
|
||||
|
||||
@@ -92,12 +92,12 @@ cdef class Asset:
|
||||
|
||||
try:
|
||||
x_as_int = PyNumber_Index(x)
|
||||
except TypeError:
|
||||
except (TypeError, OverflowError):
|
||||
return NotImplemented
|
||||
|
||||
try:
|
||||
y_as_int = PyNumber_Index(y)
|
||||
except TypeError:
|
||||
except (TypeError, OverflowError):
|
||||
return NotImplemented
|
||||
|
||||
compared = x_as_int - y_as_int
|
||||
|
||||
Reference in New Issue
Block a user