Skip to content

Commit 6e0eac4

Browse files
authored
Merge branch 'python:main' into sync_join_funcs
2 parents 0725beb + 2cd1c87 commit 6e0eac4

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

Doc/library/random.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,10 @@ be found in any statistics text.
334334

335335
.. function:: gammavariate(alpha, beta)
336336

337-
Gamma distribution. (*Not* the gamma function!) Conditions on the
338-
parameters are ``alpha > 0`` and ``beta > 0``.
337+
Gamma distribution. (*Not* the gamma function!) The shape and
338+
scale parameters, *alpha* and *beta*, must have positive values.
339+
(Calling conventions vary and some sources define 'beta'
340+
as the inverse of the scale).
339341

340342
The probability distribution function is::
341343

@@ -346,7 +348,8 @@ be found in any statistics text.
346348

347349
.. function:: gauss(mu=0.0, sigma=1.0)
348350

349-
Normal distribution, also called the Gaussian distribution. *mu* is the mean,
351+
Normal distribution, also called the Gaussian distribution.
352+
*mu* is the mean,
350353
and *sigma* is the standard deviation. This is slightly faster than
351354
the :func:`normalvariate` function defined below.
352355

Lib/asyncio/sslproto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ def abort(self):
244244
called with None as its argument.
245245
"""
246246
self._closed = True
247-
self._ssl_protocol._abort()
247+
if self._ssl_protocol is not None:
248+
self._ssl_protocol._abort()
248249

249250
def _force_close(self, exc):
250251
self._closed = True

Modules/_ctypes/_ctypes.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5476,18 +5476,25 @@ comerror_init(PyObject *self, PyObject *args, PyObject *kwds)
54765476
return 0;
54775477
}
54785478

5479+
static int
5480+
comerror_clear(PyObject *self)
5481+
{
5482+
return ((PyTypeObject *)PyExc_BaseException)->tp_clear(self);
5483+
}
5484+
54795485
static int
54805486
comerror_traverse(PyObject *self, visitproc visit, void *arg)
54815487
{
54825488
Py_VISIT(Py_TYPE(self));
5483-
return 0;
5489+
return ((PyTypeObject *)PyExc_BaseException)->tp_traverse(self, visit, arg);
54845490
}
54855491

54865492
static void
54875493
comerror_dealloc(PyObject *self)
54885494
{
54895495
PyTypeObject *tp = Py_TYPE(self);
54905496
PyObject_GC_UnTrack(self);
5497+
(void)comerror_clear(self);
54915498
tp->tp_free(self);
54925499
Py_DECREF(tp);
54935500
}
@@ -5497,6 +5504,7 @@ static PyType_Slot comerror_slots[] = {
54975504
{Py_tp_init, comerror_init},
54985505
{Py_tp_traverse, comerror_traverse},
54995506
{Py_tp_dealloc, comerror_dealloc},
5507+
{Py_tp_clear, comerror_clear},
55005508
{0, NULL},
55015509
};
55025510

0 commit comments

Comments
 (0)