summaryrefslogtreecommitdiff
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-04 07:15:20 -0600
committerGitHub <noreply@github.com>2020-03-04 14:15:20 +0100
commitdffe4c07095e0c693e094d3c140e85a68bd8128e (patch)
tree1f58f4c2f76d6f630c5279a7b72d31bb6b4d8873 /Objects/exceptions.c
parent22a9a546ff3bf2a63d77ca1e5494e758bc59132f (diff)
downloadcpython-git-dffe4c07095e0c693e094d3c140e85a68bd8128e.tar.gz
bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 631f5375f7..2baec5e3d5 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -875,7 +875,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
/* self->filename will remain Py_None otherwise */
if (filename && filename != Py_None) {
- if (Py_TYPE(self) == (PyTypeObject *) PyExc_BlockingIOError &&
+ if (Py_IS_TYPE(self, (PyTypeObject *) PyExc_BlockingIOError) &&
PyNumber_Check(filename)) {
/* BlockingIOError's 3rd argument can be the number of
* characters written.
@@ -1379,7 +1379,7 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds)
* Only applies to SyntaxError instances, not to subclasses such
* as TabError or IndentationError (see issue #31161)
*/
- if ((PyObject*)Py_TYPE(self) == PyExc_SyntaxError &&
+ if (Py_IS_TYPE(self, (PyTypeObject *)PyExc_SyntaxError) &&
self->text && PyUnicode_Check(self->text) &&
_report_missing_parentheses(self) < 0) {
return -1;