Skip to content

Commit 7d37b86

Browse files
authored
bpo-35114: Make ssl.RAND_status() return a bool (pythonGH-20063)
1 parent a77aac4 commit 7d37b86

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:func:`ssl.RAND_status` now returns a boolean value (as documented) instead
2+
of ``1`` or ``0``.

Modules/_ssl.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -5035,17 +5035,17 @@ _ssl_RAND_pseudo_bytes_impl(PyObject *module, int n)
50355035
/*[clinic input]
50365036
_ssl.RAND_status
50375037
5038-
Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.
5038+
Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.
50395039
50405040
It is necessary to seed the PRNG with RAND_add() on some platforms before
50415041
using the ssl() function.
50425042
[clinic start generated code]*/
50435043

50445044
static PyObject *
50455045
_ssl_RAND_status_impl(PyObject *module)
5046-
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=8a774b02d1dc81f3]*/
5046+
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=d5ae5aea52f36e01]*/
50475047
{
5048-
return PyLong_FromLong(RAND_status());
5048+
return PyBool_FromLong(RAND_status());
50495049
}
50505050

50515051
/*[clinic input]

Modules/clinic/_ssl.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)