diff options
Diffstat (limited to 'sources/shiboken6')
-rw-r--r-- | sources/shiboken6/doc/typesystem_converters.rst | 4 | ||||
-rw-r--r-- | sources/shiboken6/doc/typesystem_variables.rst | 8 | ||||
-rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 10 | ||||
-rw-r--r-- | sources/shiboken6/generator/shiboken/pytypenames.h | 2 | ||||
-rw-r--r-- | sources/shiboken6/generator/shiboken/shibokengenerator.cpp | 2 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/helper.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkconverter.h | 14 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkconverter_p.h | 18 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkenum.cpp | 10 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkfeature_base.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/sbkpython.h | 18 | ||||
-rw-r--r-- | sources/shiboken6/libshiboken/signature/signature_extend.cpp | 2 | ||||
-rw-r--r-- | sources/shiboken6/shibokenmodule/typesystem_shiboken.xml | 8 | ||||
-rw-r--r-- | sources/shiboken6/tests/samplebinding/typesystem_sample.xml | 16 |
14 files changed, 51 insertions, 69 deletions
diff --git a/sources/shiboken6/doc/typesystem_converters.rst b/sources/shiboken6/doc/typesystem_converters.rst index 7858eb6a9..2e41758cd 100644 --- a/sources/shiboken6/doc/typesystem_converters.rst +++ b/sources/shiboken6/doc/typesystem_converters.rst @@ -86,10 +86,10 @@ Here's how to do it: if (!PySequence_Check(pyIn) || !(PySequence_Size(pyIn) == 2)) return false; Shiboken::AutoDecRef pyReal(PySequence_GetItem(pyIn, 0)); - if (!SbkNumber_Check(pyReal)) + if (!PyNumber_Check(pyReal)) return false; Shiboken::AutoDecRef pyImag(PySequence_GetItem(pyIn, 1)); - if (!SbkNumber_Check(pyImag)) + if (!PyNumber_Check(pyImag)) return false; return true; } diff --git a/sources/shiboken6/doc/typesystem_variables.rst b/sources/shiboken6/doc/typesystem_variables.rst index 3d4638253..c6564513b 100644 --- a/sources/shiboken6/doc/typesystem_variables.rst +++ b/sources/shiboken6/doc/typesystem_variables.rst @@ -230,14 +230,14 @@ Variables .. code-block:: c++ - long a = PyInt_AS_LONG(%PYARG_1); + long a = PyLong_AS_LONG(%PYARG_1); is equivalent of .. code-block:: c++ - long a = PyInt_AS_LONG(PyTuple_GET_ITEM(%PYTHON_ARGUMENTS, 0)); + long a = PyLong_AS_LONG(PyTuple_GET_ITEM(%PYTHON_ARGUMENTS, 0)); The generator tries to be smart with attributions, but it will work for the @@ -248,7 +248,7 @@ Variables .. code-block:: c++ Py_DECREF(%PYARG_1); - %PYARG_1 = PyInt_FromLong(10); + %PYARG_1 = PyLong_FromLong(10); is equivalent of @@ -256,7 +256,7 @@ Variables .. code-block:: c++ Py_DECREF(PyTuple_GET_ITEM(%PYTHON_ARGUMENTS, 0)); - PyTuple_SET_ITEM(%PYTHON_ARGUMENTS, 0, PyInt_FromLong(10)); + PyTuple_SET_ITEM(%PYTHON_ARGUMENTS, 0, PyLong_FromLong(10)); .. _pyself: diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index cc5fb20fb..e84f29303 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -2469,7 +2469,7 @@ void CppGenerator::writeTypeCheck(TextStream &s, const OverloadData *overloadDat } // This condition trusts that the OverloadData object will arrange for - // PyInt type to come after the more precise numeric types (e.g. float and bool) + // PyLong type to come after the more precise numeric types (e.g. float and bool) AbstractMetaType argType = overloadData->argType(); if (auto viewOn = argType.viewOn()) argType = *viewOn; @@ -4242,7 +4242,7 @@ void CppGenerator::writeClassDefinition(TextStream &s, const AbstractMetaClass *qCoreApp = AbstractMetaClass::findClass(api().classes(), QLatin1String("QCoreApplication")); const bool isQApp = qCoreApp != Q_NULLPTR && metaClass->inheritsFrom(qCoreApp); - tp_flags = QLatin1String("Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES"); + tp_flags = QLatin1String("Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE"); if (metaClass->isNamespace() || metaClass->hasPrivateDestructor()) { tp_dealloc = metaClass->hasPrivateDestructor() ? QLatin1String("SbkDeallocWrapperWithPrivateDtor") : @@ -4262,7 +4262,7 @@ void CppGenerator::writeClassDefinition(TextStream &s, ? cpythonSetattroFunctionName(metaClass) : QString(); if (metaClass->hasPrivateDestructor() || onlyPrivCtor) { - // tp_flags = QLatin1String("Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES"); + // tp_flags = QLatin1String("Py_TPFLAGS_DEFAULT"); // This is not generally possible, because PySide does not care about // privacy the same way. This worked before the heap types were used, // because inheritance is not really checked for static types. @@ -5189,7 +5189,7 @@ void CppGenerator::writeEnumInitialization(TextStream &s, const AbstractMetaEnum s << "{\n"; { Indentation indent(s); - s << "PyObject *anonEnumItem = PyInt_FromLong(" << enumValueText << ");\n" + s << "PyObject *anonEnumItem = PyLong_FromLong(" << enumValueText << ");\n" << "if (PyDict_SetItemString(reinterpret_cast<PyTypeObject *>(reinterpret_cast<SbkObjectType *>(" << enclosingObjectVariable << "))->tp_dict, \"" << mangledName << "\", anonEnumItem) < 0)\n"; @@ -5900,7 +5900,7 @@ void CppGenerator::writeGetattroFunction(TextStream &s, AttroCheck attroCheck, Indentation indent(s); s << "return Py_TYPE(meth)->tp_descr_get(meth, self, nullptr);\n"; } - s << "return PyFunction_Check(meth) ? SBK_PyMethod_New(meth, self)\n" + s << "return PyFunction_Check(meth) ? PyMethod_New(meth, self)\n" << " : " << getattrFunc << ";\n"; } s << "}\n"; diff --git a/sources/shiboken6/generator/shiboken/pytypenames.h b/sources/shiboken6/generator/shiboken/pytypenames.h index 779f67f2f..d3b1fdbe9 100644 --- a/sources/shiboken6/generator/shiboken/pytypenames.h +++ b/sources/shiboken6/generator/shiboken/pytypenames.h @@ -33,7 +33,7 @@ static inline QString pyBoolT() { return QStringLiteral("PyBool"); } static inline QString pyFloatT() { return QStringLiteral("PyFloat"); } -static inline QString pyIntT() { return QStringLiteral("PyInt"); } +static inline QString pyIntT() { return QStringLiteral("PyLong"); } static inline QString pyLongT() { return QStringLiteral("PyLong"); } static inline QString pyObjectT() { return QStringLiteral("object"); } static inline QString pyStrT() { return QStringLiteral("str"); } diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp index 920c668c1..9a2588e33 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp @@ -977,7 +977,7 @@ bool ShibokenGenerator::isPyInt(const TypeEntry *type) if (!type->isPrimitive()) return false; return pythonPrimitiveTypeName(static_cast<const PrimitiveTypeEntry *>(type)) - == QLatin1String("PyInt"); + == QLatin1String("PyLong"); } bool ShibokenGenerator::isPyInt(const AbstractMetaType &type) diff --git a/sources/shiboken6/libshiboken/helper.cpp b/sources/shiboken6/libshiboken/helper.cpp index 02f8177f3..aa8d28c38 100644 --- a/sources/shiboken6/libshiboken/helper.cpp +++ b/sources/shiboken6/libshiboken/helper.cpp @@ -255,12 +255,12 @@ int *sequenceToIntArray(PyObject *obj, bool zeroTerminated) for (int i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq.object(), i); - if (!PyInt_Check(item)) { + if (!PyLong_Check(item)) { PyErr_SetString(PyExc_TypeError, "Sequence of ints expected"); delete[] array; return nullptr; } - array[i] = PyInt_AsLong(item); + array[i] = PyLong_AsLong(item); } if (zeroTerminated) diff --git a/sources/shiboken6/libshiboken/sbkconverter.h b/sources/shiboken6/libshiboken/sbkconverter.h index 6c7a29300..00d18f935 100644 --- a/sources/shiboken6/libshiboken/sbkconverter.h +++ b/sources/shiboken6/libshiboken/sbkconverter.h @@ -376,18 +376,18 @@ template<typename T> PyTypeObject *SbkType() { return nullptr; } // Below are the template specializations for C++ primitive types. template<> inline PyTypeObject *SbkType<PY_LONG_LONG>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<bool>() { return &PyBool_Type; } -template<> inline PyTypeObject *SbkType<char>() { return &PyInt_Type; } +template<> inline PyTypeObject *SbkType<char>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<double>() { return &PyFloat_Type; } template<> inline PyTypeObject *SbkType<float>() { return &PyFloat_Type; } -template<> inline PyTypeObject *SbkType<int>() { return &PyInt_Type; } +template<> inline PyTypeObject *SbkType<int>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<long>() { return &PyLong_Type; } -template<> inline PyTypeObject *SbkType<short>() { return &PyInt_Type; } -template<> inline PyTypeObject *SbkType<signed char>() { return &PyInt_Type; } +template<> inline PyTypeObject *SbkType<short>() { return &PyLong_Type; } +template<> inline PyTypeObject *SbkType<signed char>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<unsigned PY_LONG_LONG>() { return &PyLong_Type; } -template<> inline PyTypeObject *SbkType<unsigned char>() { return &PyInt_Type; } +template<> inline PyTypeObject *SbkType<unsigned char>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<unsigned int>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<unsigned long>() { return &PyLong_Type; } -template<> inline PyTypeObject *SbkType<unsigned short>() { return &PyInt_Type; } +template<> inline PyTypeObject *SbkType<unsigned short>() { return &PyLong_Type; } template<> inline PyTypeObject *SbkType<std::nullptr_t>() { return Py_TYPE(&_Py_NoneStruct); } } // namespace Shiboken @@ -395,7 +395,7 @@ template<> inline PyTypeObject *SbkType<std::nullptr_t>() { return Py_TYPE(&_Py_ // When the user adds a function with an argument unknown for the typesystem, the generator writes type checks as // TYPENAME_Check, so this macro allows users to add PyObject arguments to their added functions. #define PyObject_Check(X) true -#define SbkChar_Check(X) (SbkNumber_Check(X) || Shiboken::String::checkChar(X)) +#define SbkChar_Check(X) (PyNumber_Check(X) || Shiboken::String::checkChar(X)) struct _SbkGenericTypePrivate { SbkConverter **converter; diff --git a/sources/shiboken6/libshiboken/sbkconverter_p.h b/sources/shiboken6/libshiboken/sbkconverter_p.h index 9e23fa54c..98f39bfea 100644 --- a/sources/shiboken6/libshiboken/sbkconverter_p.h +++ b/sources/shiboken6/libshiboken/sbkconverter_p.h @@ -252,7 +252,7 @@ struct IntPrimitive : TwoPrimitive<INT> { static PyObject *toPython(const void *cppIn) { - return PyInt_FromLong(*reinterpret_cast<const INT *>(cppIn)); + return PyLong_FromLong(*reinterpret_cast<const INT *>(cppIn)); } static void toCpp(PyObject *pyIn, void *cppOut) { @@ -277,7 +277,7 @@ struct IntPrimitive : TwoPrimitive<INT> } static PythonToCppFunc isOtherConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return otherToCpp; return nullptr; } @@ -318,7 +318,7 @@ struct Primitive<PY_LONG_LONG> : OnePrimitive<PY_LONG_LONG> } static PythonToCppFunc isConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return toCpp; return nullptr; } @@ -345,7 +345,7 @@ struct Primitive<unsigned PY_LONG_LONG> : OnePrimitive<unsigned PY_LONG_LONG> } static PythonToCppFunc isConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return toCpp; return nullptr; } @@ -366,7 +366,7 @@ struct FloatPrimitive : TwoPrimitive<FLOAT> } static PythonToCppFunc isConvertible(PyObject *pyIn) { - if (PyInt_Check(pyIn) || PyLong_Check(pyIn)) + if (PyLong_Check(pyIn) || PyLong_Check(pyIn)) return toCpp; return nullptr; } @@ -376,7 +376,7 @@ struct FloatPrimitive : TwoPrimitive<FLOAT> } static PythonToCppFunc isOtherConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return otherToCpp; return nullptr; } @@ -395,13 +395,13 @@ struct Primitive<bool> : OnePrimitive<bool> } static PythonToCppFunc isConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return toCpp; return nullptr; } static void toCpp(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<bool *>(cppOut) = PyInt_AS_LONG(pyIn) != 0; + *reinterpret_cast<bool *>(cppOut) = PyLong_AS_LONG(pyIn) != 0; } }; @@ -429,7 +429,7 @@ struct CharPrimitive : IntPrimitive<CHAR> } static PythonToCppFunc isOtherConvertible(PyObject *pyIn) { - if (SbkNumber_Check(pyIn)) + if (PyNumber_Check(pyIn)) return otherToCpp; return nullptr; } diff --git a/sources/shiboken6/libshiboken/sbkenum.cpp b/sources/shiboken6/libshiboken/sbkenum.cpp index a3d17ea2e..c30c3597a 100644 --- a/sources/shiboken6/libshiboken/sbkenum.cpp +++ b/sources/shiboken6/libshiboken/sbkenum.cpp @@ -171,12 +171,12 @@ static PyObject *_enum_op(enum_func f, PyObject *a, PyObject *b) { * versions of Python (version 2) we need to convert it to int type, * respectively. * - * Thus calling PyInt_FromLong() will result in calling PyLong_FromLong in + * Thus calling PyLong_FromLong() will result in calling PyLong_FromLong in * Py3k. */ static PyObject *enum_int(PyObject *v) { - return PyInt_FromLong(reinterpret_cast<SbkEnumObject *>(v)->ob_value); + return PyLong_FromLong(reinterpret_cast<SbkEnumObject *>(v)->ob_value); } static PyObject *enum_and(PyObject *self, PyObject *b) @@ -280,7 +280,7 @@ static PyType_Spec SbkEnumType_Type_spec = { "1:Shiboken.EnumMeta", 0, // filled in later sizeof(PyMemberDef), - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, SbkEnumType_Type_slots, }; @@ -344,7 +344,7 @@ static PyObject *enum___reduce__(PyObject *obj) return Py_BuildValue("O(Ni)", enum_unpickler, Py_BuildValue("s", Py_TYPE(obj)->tp_name), - PyInt_AS_LONG(obj)); + PyLong_AS_LONG(obj)); } } // extern "C" @@ -611,7 +611,7 @@ static PyType_Spec SbkNewEnum_spec = { "1:Shiboken.Enum", sizeof(SbkEnumObject), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, SbkNewEnum_slots, }; diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp index 0cbaf46be..679cf1fe4 100644 --- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp +++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp @@ -78,13 +78,13 @@ PyObject *getFeatureSelectId() PyObject *select_id = PyDict_GetItem(feature_dict, modname); if (select_id == nullptr - || !PyInt_Check(select_id) // int/long cheating + || !PyLong_Check(select_id) // int/long cheating || select_id == undef) return last_select_id; cached_globals = globals; last_select_id = select_id; - assert(PyInt_AsSsize_t(select_id) >= 0); + assert(PyLong_AsSsize_t(select_id) >= 0); return select_id; } diff --git a/sources/shiboken6/libshiboken/sbkpython.h b/sources/shiboken6/libshiboken/sbkpython.h index 772fe76ac..60997814f 100644 --- a/sources/shiboken6/libshiboken/sbkpython.h +++ b/sources/shiboken6/libshiboken/sbkpython.h @@ -101,24 +101,6 @@ extern "C" { # include "pep384impl.h" #endif -#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 -#define PyInt_AsLong PyLong_AsLong -#define SbkNumber_Check PyNumber_Check -#define Py_TPFLAGS_CHECKTYPES 0 - -#define SBK_NB_BOOL(x) (x).nb_bool -#define SBK_PyMethod_New PyMethod_New -#define PyInt_AsSsize_t(x) PyLong_AsSsize_t(x) -#define PyString_Type PyUnicode_Type - // In Python 3, Py_TPFLAGS_DEFAULT contains Py_TPFLAGS_HAVE_VERSION_TAG, // which will trigger the attribute cache, which is not intended in Qt for Python. // Use a customized Py_TPFLAGS_DEFAULT by defining Py_TPFLAGS_HAVE_VERSION_TAG = 0. diff --git a/sources/shiboken6/libshiboken/signature/signature_extend.cpp b/sources/shiboken6/libshiboken/signature/signature_extend.cpp index 43a78ed21..528c7c87a 100644 --- a/sources/shiboken6/libshiboken/signature/signature_extend.cpp +++ b/sources/shiboken6/libshiboken/signature/signature_extend.cpp @@ -272,7 +272,7 @@ int PySide_PatchTypes(void) if (!init_done) { AutoDecRef meth_descr(PyObject_GetAttrString( - reinterpret_cast<PyObject *>(&PyString_Type), "split")); + reinterpret_cast<PyObject *>(&PyUnicode_Type), "split")); AutoDecRef wrap_descr(PyObject_GetAttrString( reinterpret_cast<PyObject *>(Py_TYPE(Py_True)), "__add__")); // abbreviations for readability diff --git a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml index 7ebc990e1..741826bff 100644 --- a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml +++ b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml @@ -116,11 +116,11 @@ <inject-code position="end"> // Add __version__ and __version_info__ attributes to the module PyObject* version = PyTuple_New(5); - PyTuple_SET_ITEM(version, 0, PyInt_FromLong(SHIBOKEN_MAJOR_VERSION)); - PyTuple_SET_ITEM(version, 1, PyInt_FromLong(SHIBOKEN_MINOR_VERSION)); - PyTuple_SET_ITEM(version, 2, PyInt_FromLong(SHIBOKEN_MICRO_VERSION)); + PyTuple_SET_ITEM(version, 0, PyLong_FromLong(SHIBOKEN_MAJOR_VERSION)); + PyTuple_SET_ITEM(version, 1, PyLong_FromLong(SHIBOKEN_MINOR_VERSION)); + PyTuple_SET_ITEM(version, 2, PyLong_FromLong(SHIBOKEN_MICRO_VERSION)); PyTuple_SET_ITEM(version, 3, Shiboken::String::fromCString(SHIBOKEN_RELEASE_LEVEL)); - PyTuple_SET_ITEM(version, 4, PyInt_FromLong(SHIBOKEN_SERIAL)); + PyTuple_SET_ITEM(version, 4, PyLong_FromLong(SHIBOKEN_SERIAL)); PyModule_AddObject(module, "__version_info__", version); PyModule_AddStringConstant(module, "__version__", SHIBOKEN_VERSION); diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml index fe5e4343c..f2f437184 100644 --- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml @@ -48,10 +48,10 @@ if (!PySequence_Check(pyIn) || !(PySequence_Size(pyIn) == 2)) return false; Shiboken::AutoDecRef pyReal(PySequence_GetItem(pyIn, 0)); - if (!SbkNumber_Check(pyReal)) + if (!PyNumber_Check(pyReal)) return false; Shiboken::AutoDecRef pyImag(PySequence_GetItem(pyIn, 1)); - if (!SbkNumber_Check(pyImag)) + if (!PyNumber_Check(pyImag)) return false; return true; } @@ -1374,7 +1374,7 @@ <replace-default-expression with="3000"/> </modify-argument> <inject-code class="native" position="beginning"> - PyObject* new_arg0 = PyInt_FromLong(PyInt_AS_LONG(%PYARG_1) - %2); + PyObject* new_arg0 = PyLong_FromLong(PyLong_AS_LONG(%PYARG_1) - %2); Py_DECREF(%PYARG_1); %PYARG_1 = new_arg0; </inject-code> @@ -1448,10 +1448,10 @@ PyObject* _obj = %PYARG_0.object(); if (!PySequence_Check(_obj) || PySequence_Fast_GET_SIZE(_obj) != 4 - || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 0)) - || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 1)) - || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 2)) - || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 3))) { + || !PyNumber_Check(PySequence_Fast_GET_ITEM(_obj, 0)) + || !PyNumber_Check(PySequence_Fast_GET_ITEM(_obj, 1)) + || !PyNumber_Check(PySequence_Fast_GET_ITEM(_obj, 2)) + || !PyNumber_Check(PySequence_Fast_GET_ITEM(_obj, 3))) { PyErr_SetString(PyExc_TypeError, "Sequence of 4 numbers expected"); } else { *%1 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(_obj, 0)); @@ -2337,7 +2337,7 @@ <conversion-rule class="native"> // Does nothing really, just test the code generation // of constructors whose arguments where - long %out = PyInt_AS_LONG(%PYARG_1) + 1; + long %out = PyLong_AS_LONG(%PYARG_1) + 1; </conversion-rule> </modify-argument> </modify-function> |