aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pysideqenum.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-08-04 12:27:17 +0200
committerChristian Tismer <tismer@stackless.com>2021-08-06 00:06:45 +0200
commita21203d534c2947a2e5f472ace3e83c552e83191 (patch)
tree99b0b5a81bfc9c885a830f36543ba97790f95b35 /sources/pyside6/libpyside/pysideqenum.cpp
parent521dc4b6dcdd7d04a9ef6afe273833016f7ba31c (diff)
Shiboken: Remove cheating macros
There are a number of cheating macros that allow to use the same code in Python 2 and 3. Because Python 2 is gone, remove these macros. This conversion was partially difficult since certain types collapsed in the XML files and generated functions contained substrings of the macros. This is actually the fourth attempt. Task-number: PYSIDE-1019 Pick-to: 6.1 Change-Id: I116877afc8aa36f4710a40df1769f600b6b750ea Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/pysideqenum.cpp')
-rw-r--r--sources/pyside6/libpyside/pysideqenum.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/pyside6/libpyside/pysideqenum.cpp b/sources/pyside6/libpyside/pysideqenum.cpp
index 07a548cb6..8abf19313 100644
--- a/sources/pyside6/libpyside/pysideqenum.cpp
+++ b/sources/pyside6/libpyside/pysideqenum.cpp
@@ -99,7 +99,7 @@ static PyObject *analyzePyEnum(PyObject *pyenum, PyObject *container = nullptr)
AutoDecRef value(PyObject_GetAttr(member, Shiboken::PyName::value()));
if (value.isNull())
return nullptr;
- if (!PyInt_Check(value)) { // int/long cheating
+ if (!PyLong_Check(value)) {
PyErr_Format(PyExc_TypeError,
"QEnum expected an int value as '%.200s', got '%.200s'",
Shiboken::String::toCString(key), Py_TYPE(value)->tp_name);
@@ -113,9 +113,9 @@ static Py_ssize_t get_lineno()
{
PyObject *frame = reinterpret_cast<PyObject *>(PyEval_GetFrame()); // borrowed ref
AutoDecRef ob_lineno(PyObject_GetAttr(frame, Shiboken::PyName::f_lineno()));
- if (ob_lineno.isNull() || !PyInt_Check(ob_lineno)) // int/long cheating
+ if (ob_lineno.isNull() || !PyLong_Check(ob_lineno))
return -1;
- return PyInt_AsSsize_t(ob_lineno); // int/long cheating
+ return PyLong_AsSsize_t(ob_lineno);
}
static bool is_module_code()