aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml5
-rw-r--r--sources/shiboken2/libshiboken/sbkpython.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index 598754fdd..403166d4a 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -394,8 +394,9 @@
double in = %CONVERTTOCPP[double](%in);
%out = %OUTTYPE(in);
</add-conversion>
- <add-conversion type="PyInt">
- int in = %CONVERTTOCPP[int](%in);
+ <!-- Using PyLong instead of PyInt to support Python2 and 3-->
+ <add-conversion type="PyInt" check="PyInt_CheckExact(%in)">
+ qlonglong in = %CONVERTTOCPP[qlonglong](%in);
%out = %OUTTYPE(in);
</add-conversion>
<add-conversion type="PyLong" check="PyLong_CheckExact(%in)">
diff --git a/sources/shiboken2/libshiboken/sbkpython.h b/sources/shiboken2/libshiboken/sbkpython.h
index 57828f624..6d90f4086 100644
--- a/sources/shiboken2/libshiboken/sbkpython.h
+++ b/sources/shiboken2/libshiboken/sbkpython.h
@@ -48,6 +48,10 @@
#define PyInt_Type PyLong_Type
#define PyInt_Check PyLong_Check
+ #define PyInt_CheckExact PyLong_CheckExact
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsUnsignedLongLongMask PyLong_AsLongLong
#define PyInt_FromLong PyLong_FromLong