diff --git a/msgspec/_core.c b/msgspec/_core.c index 738546e6..160df06d 100644 --- a/msgspec/_core.c +++ b/msgspec/_core.c @@ -4621,11 +4621,15 @@ typenode_origin_args_metadata( * abstract -> concrete mapping. If present, this is an unparametrized * collection of some form. This helps avoid compatibility issues in * Python 3.8, where unparametrized collections still have __args__. */ - origin = PyDict_GetItem(state->mod->concrete_types, t); + origin = PyDict_GetItemWithError(state->mod->concrete_types, t); if (origin != NULL) { Py_INCREF(origin); break; } + else { + /* Ignore all errors in this initial check */ + PyErr_Clear(); + } /* If `t` is a type instance, no need to inspect further */ if (PyType_CheckExact(t)) { diff --git a/setup.cfg b/setup.cfg index 86465ce0..4e937c4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,6 +12,8 @@ omit = markers = mypy pyright +filterwarnings = + error [versioneer] VCS = git