diff options
| author | Hai Shi <shihai1992@gmail.com> | 2020-10-16 16:34:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-16 10:34:15 +0200 |
| commit | c9f696cb96d1c362d5cad871f61da520572d9b08 (patch) | |
| tree | 4dbc6f4960f9058660751bd860589a6e9762ccc7 /Python/codecs.c | |
| parent | cf693e537dc8aaa14315a7f59baec4a31d1167d3 (diff) | |
| download | cpython-git-c9f696cb96d1c362d5cad871f61da520572d9b08.tar.gz | |
bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)
* Move the codecs' (un)register operation to testcases.
* Remove _codecs._forget_codec() and _PyCodec_Forget()
Diffstat (limited to 'Python/codecs.c')
| -rw-r--r-- | Python/codecs.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index a8233a73c4..ade1418720 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -208,31 +208,6 @@ PyObject *_PyCodec_Lookup(const char *encoding) return NULL; } -int _PyCodec_Forget(const char *encoding) -{ - PyObject *v; - int result; - - PyInterpreterState *interp = _PyInterpreterState_GET(); - if (interp->codec_search_path == NULL) { - return -1; - } - - /* Convert the encoding to a normalized Python string: all - characters are converted to lower case, spaces and hyphens are - replaced with underscores. */ - v = normalizestring(encoding); - if (v == NULL) { - return -1; - } - - /* Drop the named codec from the internal cache */ - result = PyDict_DelItem(interp->codec_search_cache, v); - Py_DECREF(v); - - return result; -} - /* Codec registry encoding check API. */ int PyCodec_KnownEncoding(const char *encoding) |
