Skip to content

Commit fc6559a

Browse files
committed
Remove conversions.sip conditionals meant for 4.12 but actually 4.18
- The hex version of 4.12 was not 0x041200 (current 4.18) but 0x040c00. Code was always skipped and has worked with recent sip versions.
1 parent c921dc3 commit fc6559a

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

python/core/conversions.sip

-29
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,6 @@ template<TYPE>
680680
PyObject *kobj, *tobj, *kobj2, *tobj2;
681681
Py_ssize_t i = 0;
682682

683-
//TODO: it works using SIP
684-
#if (SIP_VERSION >= 0x041200)
685-
const sipMappedType* qmap2 = sipFindMappedType("QMap<int, TYPE>");
686-
#endif
687-
688683
// Check the type if that is all that is required.
689684
if (sipIsErr == NULL)
690685
{
@@ -696,17 +691,12 @@ template<TYPE>
696691
if (!PyDict_Check(tobj))
697692
return 0;
698693

699-
#if (SIP_VERSION >= 0x041200)
700-
if (!sipCanConvertToMappedType(tobj, qmap2, SIP_NOT_NONE))
701-
return 0;
702-
#else
703694
Py_ssize_t j = 0;
704695
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
705696
{
706697
if (!sipCanConvertToType(tobj2, sipType_TYPE, SIP_NOT_NONE))
707698
return 0;
708699
}
709-
#endif
710700
}
711701
return 1;
712702
}
@@ -717,24 +707,6 @@ template<TYPE>
717707
{
718708
qint64 k = PyLong_AsLongLong(kobj);
719709

720-
#if (SIP_VERSION >= 0x041200)
721-
// TODO: search for the minimum SIP version this code works on, it works
722-
// on SIP 4.13.3 (GS). See #else to know why the version check is needed.
723-
724-
int state;
725-
726-
TYPE* t = reinterpret_cast<TYPE*>(sipConvertToMappedType(tobj, qmap2, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
727-
728-
if (*sipIsErr)
729-
{
730-
sipReleaseMappedType(t, qmap2, state);
731-
delete qm;
732-
return 0;
733-
}
734-
735-
qm.insert(k, *t);
736-
sipReleaseMappedType(t, qmap2, state);
737-
#else
738710
// using sipConvertToMappedType to convert directly to QMap<int, TYPE> doesn't work
739711
// and ends with a segfault
740712

@@ -759,7 +731,6 @@ template<TYPE>
759731
sipReleaseType(t2, sipType_TYPE, state);
760732
}
761733
qm->insert(k, qm2);
762-
#endif
763734
}
764735

765736
*sipCppPtr = qm;

0 commit comments

Comments
 (0)