|
Line
Link Here
|
| 0 |
-- PyQt5_gpl-5.13.0/qpy/QtCore/qpycore_qstring.cpp |
0 |
++ PyQt5_gpl-5.13.1.dev1907281803/qpy/QtCore/qpycore_qstring.cpp |
|
Lines 161-174
Link Here
|
| 161 |
// Convert a Python string object to a QString. |
161 |
// Convert a Python string object to a QString. |
| 162 |
QString qpycore_PyObject_AsQString(PyObject *obj) |
162 |
QString qpycore_PyObject_AsQString(PyObject *obj) |
| 163 |
{ |
163 |
{ |
| 164 |
#if PY_MAJOR_VERSION <= 2 |
164 |
#if PY_MAJOR_VERSION < 3 |
| 165 |
const char *obj_s = PyString_AsString(obj); |
165 |
if (PyString_Check(obj)) |
|
|
166 |
{ |
| 167 |
const char *obj_s = PyString_AsString(obj); |
| 166 |
|
168 |
|
| 167 |
if (!obj_s) |
169 |
if (!obj_s) |
| 168 |
return QString(); |
170 |
return QString(); |
| 169 |
|
171 |
|
| 170 |
return QString::fromUtf8(obj_s); |
172 |
return QString::fromUtf8(obj_s); |
| 171 |
#elif defined(PYQT_PEP_393) |
173 |
} |
|
|
174 |
#endif |
| 175 |
|
| 176 |
#if defined(PYQT_PEP_393) |
| 172 |
int char_size; |
177 |
int char_size; |
| 173 |
Py_ssize_t len; |
178 |
Py_ssize_t len; |
| 174 |
void *data = sipUnicodeData(obj, &char_size, &len); |
179 |
void *data = sipUnicodeData(obj, &char_size, &len); |