Skip to content

Commit 5789dd8

Browse files
committed
python3 compatibility fix
1 parent 3904722 commit 5789dd8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/core/conversions.sip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,11 @@ template<int, TYPE2*>
14331433

14341434
const int t1 = i.key();
14351435
TYPE2 * t2 = i.value();
1436+
#if (PY_VERSION_HEX < 0x03000000)
14361437
PyObject *t1obj = PyInt_FromSize_t(t1);
1438+
#else
1439+
PyObject *t1obj = PyLong_FromSize_t(t1);
1440+
#endif
14371441
PyObject *t2obj = sipConvertFromType(t2, sipType_TYPE2, sipTransferObj);
14381442
if (PyDict_GetItem(d, t1obj) == NULL)
14391443
{

0 commit comments

Comments
 (0)