From c9f696cb96d1c362d5cad871f61da520572d9b08 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 16 Oct 2020 16:34:15 +0800 Subject: 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() --- Python/codecs.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'Python/codecs.c') 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) -- cgit v1.2.1