Skip to content

Commit 632601b

Browse files
committed
Python compatibility patch for 3.0-3.2
1 parent 2ce4b8a commit 632601b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/python/qgspythonutilsimpl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
#include <QStringList>
3434
#include <QDir>
3535

36-
#ifdef PYTHON2
36+
#if (PY_VERSION_HEX < 0x03000000)
3737
#define PYOBJ2QSTRING(obj) PyString_AsString( obj )
38+
#elif (PY_VERSION_HEX < 0x03030000)
39+
#define PYOBJ2QSTRING(obj) QString::fromUtf8( PyBytes_AsString(PyUnicode_AsUTF8String( obj ) ) )
3840
#else
3941
#define PYOBJ2QSTRING(obj) QString::fromUtf8( PyUnicode_AsUTF8( obj ) )
4042
#endif

0 commit comments

Comments
 (0)