diff --git a/gappy/element.pyx b/gappy/element.pyx index 1228b8e..ea63002 100644 --- a/gappy/element.pyx +++ b/gappy/element.pyx @@ -343,12 +343,10 @@ cdef Obj make_gap_string(s) except NULL: >>> gap('string') # indirect doctest "string" """ - cdef Obj result try: GAP_Enter() b = str_to_bytes(s) - C_NEW_STRING(result, len(b), b) - return result + return GAP_MakeStringWithLen(b, len(b)) finally: GAP_Leave() diff --git a/gappy/gap_includes.pxd b/gappy/gap_includes.pxd index 29c08ff..4614c43 100644 --- a/gappy/gap_includes.pxd +++ b/gappy/gap_includes.pxd @@ -177,4 +177,4 @@ cdef extern from "gap/records.h" nogil: cdef extern from "gap/stringobj.h" nogil: - void C_NEW_STRING(Obj new_gap_string, int length, char* c_string) + Obj GAP_MakeStringWithLen "MakeStringWithLen" (char *, size_t)