Skip to content

Commit af03e78

Browse files
committed
Fix compiler warning
1 parent 50b7875 commit af03e78

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

codecs/text.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cdef inline as_pg_string_and_size(
1212
raise TypeError('expected str, got {}'.format(type(obj).__name__))
1313

1414
if settings.is_encoding_utf8():
15-
cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size)
15+
cstr[0] = <char*>cpythonx.PyUnicode_AsUTF8AndSize(obj, size)
1616
else:
1717
encoded = settings.get_text_codec().encode(obj)
1818
cpython.PyBytes_AsStringAndSize(encoded, cstr, size)

cpythonx.pxd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ cdef extern from "Python.h":
1313
char* PyByteArray_AsString(object)
1414

1515
object PyUnicode_FromString(const char *u)
16-
char* PyUnicode_AsUTF8AndSize(object unicode, ssize_t *size) except NULL
16+
const char* PyUnicode_AsUTF8AndSize(
17+
object unicode, ssize_t *size) except NULL

0 commit comments

Comments
 (0)