Skip to content

Commit

Permalink
Fixed #657 -- handle OverflowErrors on large allocation requests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 7, 2017
1 parent a421276 commit ecc0325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_rand.py
Expand Up @@ -32,10 +32,10 @@ def test_bytes_wrong_args(self, args):

def test_insufficient_memory(self):
"""
`OpenSSL.rand.bytes` raises `MemoryError` if more bytes are requested
than will fit in memory.
`OpenSSL.rand.bytes` raises `MemoryError` or `OverflowError` if more
bytes are requested than will fit in memory.
"""
with pytest.raises(MemoryError):
with pytest.raises((MemoryError, OverflowError)):
rand.bytes(sys.maxsize)

def test_bytes(self):
Expand Down

0 comments on commit ecc0325

Please sign in to comment.