The maximum of Py_ssize_t is the more relevant value here.  Plus there is no maxint on Python 3.
diff --git a/OpenSSL/test/test_rand.py b/OpenSSL/test/test_rand.py
index 7d2559e..84b97c5 100644
--- a/OpenSSL/test/test_rand.py
+++ b/OpenSSL/test/test_rand.py
@@ -30,7 +30,7 @@
         :py:obj:`OpenSSL.rand.bytes` raises :py:obj:`MemoryError` if more bytes
         are requested than will fit in memory.
         """
-        self.assertRaises(MemoryError, rand.bytes, sys.maxint)
+        self.assertRaises(MemoryError, rand.bytes, sys.maxsize)
 
 
     def test_bytes(self):