Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tidy up type check for note (Kumar's review comments)
  • Loading branch information
iritkatriel committed Dec 2, 2021
commit 77858af5c0d7e407ae0d9b9d7c580cc0c53cb2ba
4 changes: 2 additions & 2 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ BaseException_set_note(PyBaseExceptionObject *self, PyObject *note,
PyErr_SetString(PyExc_TypeError, "__note__ may not be deleted");
return -1;
}
Comment thread
iritkatriel marked this conversation as resolved.
else if (note != Py_None && !PyUnicode_Check(note)) {
PyErr_SetString(PyExc_TypeError, "__note__ must be an str or None");
else if (note != Py_None && !PyUnicode_CheckExact(note)) {
PyErr_SetString(PyExc_TypeError, "__note__ must be a string or None");
return -1;
}

Expand Down