Visitar URL original
bpo-41842: Add a unregister function in _codecs module by shihai1991 · Pull Request #22360 · python/cpython · GitHub
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
apply victor's comment
  • Loading branch information
shihai1991 committed Sep 26, 2020
commit 4308ea8fc744e377bfeab38157767cecfe377e10
2 changes: 1 addition & 1 deletion Python/codecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PyCodec_Unregister(PyObject *search_function)
PyObject *item = PyList_GET_ITEM(codec_search_path, i);
if (item == search_function) {
Comment thread
shihai1991 marked this conversation as resolved.
if (interp->codec_search_cache != NULL) {
assert(PyDict_Check(interp->codec_search_cache));
assert(PyDict_CheckExact(interp->codec_search_cache));
PyDict_Clear(interp->codec_search_cache);
}
return PyList_SetSlice(codec_search_path, i, i+1, NULL);
Expand Down