Skip to content

Commit

Permalink
address review: drop OverflowError in Lib/_pydecimal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jan 27, 2025
1 parent 7caf3e5 commit 35f7035
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Lib/_pydecimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@ def IEEEContext(bits, /):
"""
import sys

if bits >= sys.maxsize:
raise OverflowError("Python int too large to convert to C ssize_t")
if bits <= 0 or bits > IEEE_CONTEXT_MAX_BITS or bits % 32:
raise ValueError("argument must be a multiple of 32, "
f"with a maximum of {IEEE_CONTEXT_MAX_BITS}")
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4417,7 +4417,6 @@ def assert_rest(self, context):
assert_rest(self, c)

# Invalid values
self.assertRaises(OverflowError, IEEEContext, sys.maxsize + 1)
self.assertRaises(ValueError, IEEEContext, -1)
self.assertRaises(ValueError, IEEEContext, 123)
self.assertRaises(ValueError, IEEEContext, 1024)
Expand Down

0 comments on commit 35f7035

Please sign in to comment.