Skip to content

Commit 1b0a910

Browse files
jcfrmrbean-bremen
authored andcommitted
chore(PythonQt): replace PyInt_Type with PyLong_Type
No functional change intended.
1 parent 95f99ff commit 1b0a910

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/PythonQt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, Py
845845
PyObject* className = PyString_FromString(enumName);
846846

847847
PyObject* baseClasses = PyTuple_New(1);
848-
Py_INCREF(&PyInt_Type);
849-
PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
848+
Py_INCREF(&PyLong_Type);
849+
PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyLong_Type);
850850

851851
PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
852852
PyObject* typeDict = PyDict_New();

src/PythonQtConversion.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,10 @@ bool PythonQtConv::PyObjGetBool(PyObject* val, bool strict, bool &ok) {
886886
int PythonQtConv::PyObjGetInt(PyObject* val, bool strict, bool &ok) {
887887
int d = 0;
888888
ok = true;
889-
if (val->ob_type == &PyInt_Type) {
889+
if (val->ob_type == &PyLong_Type) {
890890
d = PyInt_AS_LONG(val);
891891
} else if (!strict) {
892-
if (PyObject_TypeCheck(val, &PyInt_Type)) {
892+
if (PyObject_TypeCheck(val, &PyLong_Type)) {
893893
// support for derived int classes, e.g. for our enums
894894
d = PyInt_AS_LONG(val);
895895
} else if (val->ob_type == &PyFloat_Type) {
@@ -922,7 +922,7 @@ qint64 PythonQtConv::PyObjGetLongLong(PyObject* val, bool strict, bool &ok) {
922922
if (val->ob_type == &PyLong_Type) {
923923
d = PyLong_AsLongLong(val);
924924
} else if (!strict) {
925-
if (PyObject_TypeCheck(val, &PyInt_Type)) {
925+
if (PyObject_TypeCheck(val, &PyLong_Type)) {
926926
// support for derived int classes, e.g. for our enums
927927
d = PyInt_AS_LONG(val);
928928
} else if (val->ob_type == &PyFloat_Type) {
@@ -952,7 +952,7 @@ quint64 PythonQtConv::PyObjGetULongLong(PyObject* val, bool strict, bool &ok) {
952952
if (Py_TYPE(val) == &PyLong_Type) {
953953
d = PyLong_AsUnsignedLongLong(val);
954954
} else if (!strict) {
955-
if (PyObject_TypeCheck(val, &PyInt_Type)) {
955+
if (PyObject_TypeCheck(val, &PyLong_Type)) {
956956
// support for derived int classes, e.g. for our enums
957957
d = PyInt_AS_LONG(val);
958958
} else if (val->ob_type == &PyFloat_Type) {

src/PythonQtPythonInclude.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
#define PyString_FromFormat PyUnicode_FromFormat
127127
#define PyString_Check PyUnicode_Check
128128

129-
#define PyInt_Type PyLong_Type
130129
#define PyInt_FromLong PyLong_FromLong
131130
#define PyInt_AS_LONG PyLong_AS_LONG
132131
#define PyInt_Check PyLong_Check

0 commit comments

Comments
 (0)