summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/py_utils.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/py_utils.cc b/src/py_utils.cc
index cd44aa93..8765bb78 100644
--- a/src/py_utils.cc
+++ b/src/py_utils.cc
@@ -134,7 +134,8 @@ struct string_from_python
PyUnicode_GET_SIZE(obj_ptr);
#endif
#if PY_MINOR_VERSION < 12
- PyUnicode_READY(obj_ptr);
+ if (PyUnicode_READY(obj_ptr))
+ return;
#endif
switch (PyUnicode_KIND(obj_ptr)) {
case PyUnicode_1BYTE_KIND: {