diff options
Diffstat (limited to 'sip/qt/qbytearray.sip')
-rw-r--r-- | sip/qt/qbytearray.sip | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sip/qt/qbytearray.sip b/sip/qt/qbytearray.sip index d975472..f25ecd6 100644 --- a/sip/qt/qbytearray.sip +++ b/sip/qt/qbytearray.sip @@ -115,11 +115,7 @@ static PyObject* TQByteArray_To_String(TQByteArray *ba) if (data) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromStringAndSize(data, len); -#else - return SIPBytes_FromStringAndSize(data, len); -#endif } else { @@ -178,7 +174,7 @@ public: if (res == Py_None) { - sipRes = SIPBytes_FromString(""); + sipRes = PyBytes_FromString(""); } else { @@ -191,7 +187,7 @@ public: // Allow a Python string whenever a TQByteArray is expected. if (sipIsErr == NULL) - return (SIPBytes_Check(sipPy) || + return (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy) || sipCanConvertToInstance(sipPy,sipClass_TQByteArray,SIP_NO_CONVERTORS)); @@ -210,7 +206,6 @@ public: return sipGetState(sipTransferObj); } -#if PY_VERSION_HEX >= 0x02060000 else if (PyByteArray_Check(sipPy)) { Py_BEGIN_ALLOW_THREADS @@ -223,13 +218,12 @@ public: return sipGetState(sipTransferObj); } -#endif - else if (SIPBytes_Check(sipPy)) + else if (PyBytes_Check(sipPy)) { Py_BEGIN_ALLOW_THREADS TQByteArray *ba = new TQByteArray(); - ba -> duplicate(SIPBytes_AS_STRING(sipPy),SIPBytes_GET_SIZE(sipPy)); + ba -> duplicate(PyBytes_AS_STRING(sipPy),PyBytes_GET_SIZE(sipPy)); *sipCppPtr = ba; Py_END_ALLOW_THREADS |