bpo-39824: Convert PyModule_GetState() to get_module_state() (GH-19076)

Automerge-Triggered-By: @vstinner
This commit is contained in:
Hai Shi 2020-03-20 01:11:33 +08:00 committed by GitHub
parent 5a3a71dddb
commit 13397ee47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -775,25 +775,25 @@ static struct PyModuleDef_Slot _locale_slots[] = {
}; };
static int static int
locale_traverse(PyObject *m, visitproc visit, void *arg) locale_traverse(PyObject *module, visitproc visit, void *arg)
{ {
_locale_state *state = (_locale_state*)PyModule_GetState(m); _locale_state *state = get_locale_state(module);
Py_VISIT(state->Error); Py_VISIT(state->Error);
return 0; return 0;
} }
static int static int
locale_clear(PyObject *m) locale_clear(PyObject *module)
{ {
_locale_state *state = (_locale_state*)PyModule_GetState(m); _locale_state *state = get_locale_state(module);
Py_CLEAR(state->Error); Py_CLEAR(state->Error);
return 0; return 0;
} }
static void static void
locale_free(PyObject *m) locale_free(PyObject *module)
{ {
locale_clear(m); locale_clear(module);
} }
static struct PyModuleDef _localemodule = { static struct PyModuleDef _localemodule = {

View File

@ -1925,7 +1925,7 @@ static PyMethodDef audioop_methods[] = {
static int static int
audioop_traverse(PyObject *module, visitproc visit, void *arg) audioop_traverse(PyObject *module, visitproc visit, void *arg)
{ {
audioop_state *state = (audioop_state *)PyModule_GetState(module); audioop_state *state = get_audioop_state(module);
Py_VISIT(state->AudioopError); Py_VISIT(state->AudioopError);
return 0; return 0;
} }
@ -1933,7 +1933,7 @@ audioop_traverse(PyObject *module, visitproc visit, void *arg)
static int static int
audioop_clear(PyObject *module) audioop_clear(PyObject *module)
{ {
audioop_state *state = (audioop_state *)PyModule_GetState(module); audioop_state *state = get_audioop_state(module);
Py_CLEAR(state->AudioopError); Py_CLEAR(state->AudioopError);
return 0; return 0;
} }