summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-21 22:33:43 (GMT)
committerGitHub <noreply@github.com>2022-01-21 22:33:43 (GMT)
commitac1f152421fab3ac854fe4565c575b306e2bb4b5 (patch)
tree90014ae2e0e269f96472fdec37a9d88a4fed010b /Objects/exceptions.c
parent7835cbf949c413a746324721a352cc72670a8a36 (diff)
downloadcpython-ac1f152421fab3ac854fe4565c575b306e2bb4b5.zip
cpython-ac1f152421fab3ac854fe4565c575b306e2bb4b5.tar.gz
cpython-ac1f152421fab3ac854fe4565c575b306e2bb4b5.tar.bz2
bpo-46417: Use _PyType_CAST() in Objects directory (GH-30764)
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 403d2d4..22a4713 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1775,8 +1775,7 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *newtype;
newtype = PyDict_GetItemWithError(state->errnomap, myerrno);
if (newtype) {
- assert(PyType_Check(newtype));
- type = (PyTypeObject *) newtype;
+ type = _PyType_CAST(newtype);
}
else if (PyErr_Occurred())
goto error;