Skip to content
Prev Previous commit
Next Next commit
Remove assert accidentally commited
  • Loading branch information
cmaloney committed Oct 9, 2024
commit e2eebb061cb0ec6c7746dc35625ae69585590b4f
1 change: 0 additions & 1 deletion Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
out the old fd (see: internal_close) should always nullify
self->stat_atopen before this point. Just in case though, to prevent
leaks, only allocate a new one if required. */
assert(self->stat_atopen == NULL)
if (self->stat_atopen != NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyMem_Free(NULL) is well defined: it does nothing, so you might omit the if (stat_atopen != NULL) test.

self->stat_atopen = PyMem_New(struct _Py_stat_struct, 1);
if (self->stat_atopen == NULL) {
Expand Down