Skip to content

Commit

Permalink
Suppress hashing error when parsing annotated types
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed Oct 13, 2024
1 parent a0cc7ea commit 36e56c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion msgspec/_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ omit =
markers =
mypy
pyright
filterwarnings =
error

[versioneer]
VCS = git
Expand Down

0 comments on commit 36e56c4

Please sign in to comment.