summaryrefslogtreecommitdiffstats
path: root/PC/winreg.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-14 17:49:51 (GMT)
committerGitHub <noreply@github.com>2022-11-14 17:49:51 (GMT)
commitf5e326e2b6b3f008ed71ccf9e6c3e18a6618ea45 (patch)
treee042a78eb85ccab220acb1074fcb58d0da6e1037 /PC/winreg.c
parent1089bdc81aecf6adaf636547d4cf3949ec5d8d2c (diff)
downloadcpython-f5e326e2b6b3f008ed71ccf9e6c3e18a6618ea45.zip
cpython-f5e326e2b6b3f008ed71ccf9e6c3e18a6618ea45.tar.gz
cpython-f5e326e2b6b3f008ed71ccf9e6c3e18a6618ea45.tar.bz2
gh-99300: Use Py_NewRef() in PC/ directory (#99479)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the PC/ directory.
Diffstat (limited to 'PC/winreg.c')
-rw-r--r--PC/winreg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 6ae0d81..df34e8c 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -308,8 +308,7 @@ static PyHKEYObject *
winreg_HKEYType___enter___impl(PyHKEYObject *self)
/*[clinic end generated code: output=52c34986dab28990 input=c40fab1f0690a8e2]*/
{
- Py_XINCREF(self);
- return self;
+ return (PyHKEYObject*)Py_XNewRef(self);
}
@@ -784,8 +783,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
support it natively, we should handle the bits. */
default:
if (retDataSize == 0) {
- Py_INCREF(Py_None);
- obData = Py_None;
+ obData = Py_NewRef(Py_None);
}
else
obData = PyBytes_FromStringAndSize(