Skip to content

Commit 5f49d78

Browse files
committed
chore(PythonQt): replace PyString_AS_STRING with PyUnicode_AsUTF8
This removes dependence on the `PyString_*` shim and documents the Python 3 assumption clearly. No functional change intended.
1 parent dfc0d8b commit 5f49d78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PythonQt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ QVariant PythonQt::evalCode(PyObject* object, PyObject* pycode) {
986986
globals = dict;
987987
} else {
988988
dict = PyObject_GetAttrString(object, "__dict__");
989-
globals = PyObject_GetAttrString(PyImport_ImportModule(PyString_AS_STRING(PyObject_GetAttrString(object, "__module__"))),"__dict__");
989+
globals = PyObject_GetAttrString(PyImport_ImportModule(PyUnicode_AsUTF8(PyObject_GetAttrString(object, "__module__"))),"__dict__");
990990
}
991991
PyObject* r = nullptr;
992992
if (dict) {

0 commit comments

Comments
 (0)