summaryrefslogtreecommitdiffstats
path: root/Modules/ossaudiodev.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-14 15:21:23 (GMT)
committerGitHub <noreply@github.com>2022-11-14 15:21:23 (GMT)
commit3e2f7135e6164860b763cf5d0d22b9dc12409767 (patch)
treed32b9ee479403299d16d9fe723618667a81591d5 /Modules/ossaudiodev.c
parente3d4fed07429670af631e5662086b76c1ec098c4 (diff)
downloadcpython-3e2f7135e6164860b763cf5d0d22b9dc12409767.zip
cpython-3e2f7135e6164860b763cf5d0d22b9dc12409767.tar.gz
cpython-3e2f7135e6164860b763cf5d0d22b9dc12409767.tar.bz2
gh-99300: Use Py_NewRef() in Modules/ directory (#99469)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory.
Diffstat (limited to 'Modules/ossaudiodev.c')
-rw-r--r--Modules/ossaudiodev.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index f1c126f..79f4eba 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -534,8 +534,7 @@ oss_close(oss_audio_t *self, PyObject *unused)
static PyObject *
oss_self(PyObject *self, PyObject *unused)
{
- Py_INCREF(self);
- return self;
+ return Py_NewRef(self);
}
static PyObject *
@@ -1135,10 +1134,8 @@ PyInit_ossaudiodev(void)
NULL, NULL);
if (OSSAudioError) {
/* Each call to PyModule_AddObject decrefs it; compensate: */
- Py_INCREF(OSSAudioError);
- Py_INCREF(OSSAudioError);
- PyModule_AddObject(m, "error", OSSAudioError);
- PyModule_AddObject(m, "OSSAudioError", OSSAudioError);
+ PyModule_AddObject(m, "error", Py_NewRef(OSSAudioError));
+ PyModule_AddObject(m, "OSSAudioError", Py_NewRef(OSSAudioError));
}
/* Build 'control_labels' and 'control_names' lists and add them