Commit 1898084a authored by Guido van Rossum's avatar Guido van Rossum

More PyBytes -> PyString.

parent f9e443c4
...@@ -6568,11 +6568,11 @@ win32_urandom(PyObject *self, PyObject *args) ...@@ -6568,11 +6568,11 @@ win32_urandom(PyObject *self, PyObject *args)
} }
/* Allocate bytes */ /* Allocate bytes */
result = PyBytes_FromStringAndSize(NULL, howMany); result = PyString_FromStringAndSize(NULL, howMany);
if (result != NULL) { if (result != NULL) {
/* Get random data */ /* Get random data */
if (! pCryptGenRandom(hCryptProv, howMany, (unsigned char*) if (! pCryptGenRandom(hCryptProv, howMany, (unsigned char*)
PyBytes_AS_STRING(result))) { PyString_AS_STRING(result))) {
Py_DECREF(result); Py_DECREF(result);
return win32_error("CryptGenRandom", NULL); return win32_error("CryptGenRandom", NULL);
} }
...@@ -6639,11 +6639,11 @@ vms_urandom(PyObject *self, PyObject *args) ...@@ -6639,11 +6639,11 @@ vms_urandom(PyObject *self, PyObject *args)
"negative argument not allowed"); "negative argument not allowed");
/* Allocate bytes */ /* Allocate bytes */
result = PyBytes_FromStringAndSize(NULL, howMany); result = PyString_FromStringAndSize(NULL, howMany);
if (result != NULL) { if (result != NULL) {
/* Get random data */ /* Get random data */
if (RAND_pseudo_bytes((unsigned char*) if (RAND_pseudo_bytes((unsigned char*)
PyBytes_AS_STRING(result), PyString_AS_STRING(result),
howMany) < 0) { howMany) < 0) {
Py_DECREF(result); Py_DECREF(result);
return PyErr_Format(PyExc_ValueError, return PyErr_Format(PyExc_ValueError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment