diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-14 15:21:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 15:21:23 (GMT) |
commit | 3e2f7135e6164860b763cf5d0d22b9dc12409767 (patch) | |
tree | d32b9ee479403299d16d9fe723618667a81591d5 /Modules/ossaudiodev.c | |
parent | e3d4fed07429670af631e5662086b76c1ec098c4 (diff) | |
download | cpython-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.c | 9 |
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 |