Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/c/_cffi_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,7 @@ typedef struct {
#include "minibuffer.h"
#include "file_emulator.h"

#ifdef PyUnicode_KIND /* Python >= 3.3 */
# include "wchar_helper_3.h"
#else
# include "wchar_helper.h"
#endif
#include "wchar_helper.h"

#include "../cffi/_cffi_errors.h"

Expand Down Expand Up @@ -3613,9 +3609,7 @@ static PyTypeObject CDataGCP_Type = {
0, /* inherited */ /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT /* tp_flags */
#ifdef Py_TPFLAGS_HAVE_FINALIZE
| Py_TPFLAGS_HAVE_FINALIZE
#endif
| Py_TPFLAGS_HAVE_GC,
"This is an internal subtype of _CDataBase for performance only on "
"CPython. Check with isinstance(x, ffi.CData).", /* tp_doc */
Expand All @@ -3629,7 +3623,6 @@ static PyTypeObject CDataGCP_Type = {
0, /* tp_members */
0, /* tp_getset */
&CData_Type, /* tp_base */
#ifdef Py_TPFLAGS_HAVE_FINALIZE /* CPython >= 3.4 */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
Expand All @@ -3647,7 +3640,6 @@ static PyTypeObject CDataGCP_Type = {
0, /* tp_del */
0, /* version_tag */
(destructor)cdatagcp_finalize, /* tp_finalize */
#endif
};

/************************************************************/
Expand Down
12 changes: 6 additions & 6 deletions src/c/ffi_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static PyObject *ffi_cast(FFIObject *self, PyObject *args)
}

PyDoc_STRVAR(ffi_string_doc,
"Return a Python string (or unicode string) from the 'cdata'. If\n"
"Return a Python string from the 'cdata'. If\n"
"'cdata' is a pointer or array of characters or bytes, returns the\n"
"null-terminated string. The returned string extends until the first\n"
"null character, or at most 'maxlen' characters. If 'cdata' is an\n"
Expand All @@ -457,7 +457,7 @@ PyDoc_STRVAR(ffi_string_doc,
"following the same rules.\n"
"\n"
"If 'cdata' is a single character or byte or a wchar_t, returns it as a\n"
"string or unicode string.\n"
"string.\n"
"\n"
"If 'cdata' is an enum, returns the value of the enumerator as a\n"
"string, or 'NUMBER' if the value is out of range.");
Expand All @@ -467,13 +467,13 @@ PyDoc_STRVAR(ffi_string_doc,

PyDoc_STRVAR(ffi_unpack_doc,
"Unpack an array of C data of the given length,\n"
"returning a Python string/unicode/list.\n"
"returning a Python string/list.\n"
"\n"
"If 'cdata' is a pointer to 'char', returns a byte string.\n"
"It does not stop at the first null. This is equivalent to:\n"
"ffi.buffer(cdata, length)[:]\n"
"\n"
"If 'cdata' is a pointer to 'wchar_t', returns a unicode string.\n"
"If 'cdata' is a pointer to 'wchar_t', returns a string.\n"
"'length' is measured in wchar_t's; it is not the size in bytes.\n"
"\n"
"If 'cdata' is a pointer to anything else, returns a list of\n"
Expand Down Expand Up @@ -662,7 +662,7 @@ static PyObject *ffi_getctype(FFIObject *self, PyObject *args, PyObject *kwds)
if (add_paren)
p[replace_with_len] = ')';

/* bytes -> unicode string */
/* bytes -> string */
u = PyUnicode_DecodeLatin1(PyBytes_AS_STRING(res),
PyBytes_GET_SIZE(res),
NULL);
Expand Down Expand Up @@ -696,7 +696,7 @@ PyDoc_STRVAR(ffi_from_handle_doc,
PyDoc_STRVAR(ffi_from_buffer_doc,
"Return a <cdata 'char[]'> that points to the data of the given Python\n"
"object, which must support the buffer interface. Note that this is\n"
"not meant to be used on the built-in types str or unicode\n"
"not meant to be used on the built-in type str\n"
"(you can build 'char[]' arrays explicitly) but only on objects\n"
"containing large quantities of raw data in some other format, like\n"
"'array.array' or numpy arrays.");
Expand Down
Loading
Loading