summaryrefslogtreecommitdiffstats
path: root/src/if_python3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 8a7a3a4b17..8a5b3329e0 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -86,7 +86,8 @@
#ifndef PyString_Check
# define PyString_Check(obj) PyUnicode_Check(obj)
#endif
-#define PyString_FromString(repr) PyUnicode_FromString(repr)
+#define PyString_FromString(repr) \
+ PyUnicode_Decode(repr, STRLEN(repr), ENC_OPT, NULL)
#define PyString_FromFormat PyUnicode_FromFormat
#ifndef PyInt_Check
# define PyInt_Check(obj) PyLong_Check(obj)