Skip to content

Commit 0547bf0

Browse files
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 63892dc commit 0547bf0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Other language changes
204204
controlled by :ref:`environment variables <using-on-controlling-color>`.
205205
(Contributed by Peter Bierma in :gh:`134170`.)
206206

207+
207208
New modules
208209
===========
209210

Python/errors.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,14 +1444,15 @@ make_unraisable_hook_args(PyThreadState *tstate, PyObject *exc_type,
14441444
14451445
It can be called to log the exception of a custom sys.unraisablehook.
14461446
1447-
This assumes file is non-NULL.
1447+
This assumes 'file' neither NULL nor None.
14481448
*/
14491449
static int
14501450
write_unraisable_exc_file(PyThreadState *tstate, PyObject *exc_type,
14511451
PyObject *exc_value, PyObject *exc_tb,
14521452
PyObject *err_msg, PyObject *obj, PyObject *file)
14531453
{
1454-
assert(file != NULL && !Py_IsNone(file));
1454+
assert(file != NULL);
1455+
assert(!Py_IsNone(file));
14551456
if (obj != NULL && obj != Py_None) {
14561457
if (err_msg != NULL && err_msg != Py_None) {
14571458
if (PyFile_WriteObject(err_msg, file, Py_PRINT_RAW) < 0) {

0 commit comments

Comments
 (0)