diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-31 06:09:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 06:09:36 (GMT) |
commit | 48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202 (patch) | |
tree | 6678ae7f56e368ef192b8e0f5988f7c317dbb246 /PC | |
parent | dc9039da239ee572eaaf56e4a026be1fc4d74e24 (diff) | |
download | cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.zip cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.gz cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.bz2 |
[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
Diffstat (limited to 'PC')
-rw-r--r-- | PC/_winreg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/PC/_winreg.c b/PC/_winreg.c index e139cce..f0f8df3 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -641,7 +641,7 @@ PyHKEY_AsHKEY(PyObject *ob, HKEY *pHANDLE, BOOL bNoneOK) PyHKEYObject *pH = (PyHKEYObject *)ob; *pHANDLE = pH->hkey; } - else if (PyInt_Check(ob) || PyLong_Check(ob)) { + else if (_PyAnyInt_Check(ob)) { /* We also support integers */ PyErr_Clear(); *pHANDLE = (HKEY)PyLong_AsVoidPtr(ob); @@ -753,8 +753,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) Py_ssize_t i,j; switch (typ) { case REG_DWORD: - if (value != Py_None && - !(PyInt_Check(value) || PyLong_Check(value))) + if (value != Py_None && !_PyAnyInt_Check(value)) return FALSE; *retDataBuf = (BYTE *)PyMem_NEW(DWORD, 1); if (*retDataBuf==NULL){ |