Skip to content

Commit 8977ff3

Browse files
committed
drop unused PyString_FromStringAndSize and PyString_AsUtf8AndSize
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
1 parent 908edee commit 8977ff3

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

src/platform.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,17 @@ typedef int Py_ssize_t;
3737

3838
#if PY_MAJOR_VERSION >= 3
3939
#define PY3K 1
40-
#define PyString_FromStringAndSize PyUnicode_FromStringAndSize
4140

4241
#define PyString_AsString PyUnicode_AsUTF8
43-
#define PyString_AsUtf8AndSize PyUnicode_AsUTF8AndSize
4442

4543
#define PyCreateDummyObject PyModule_New
4644

4745
#define PyString_FSConverter PyUnicode_FSConverter
4846
#else // PY3K
4947

50-
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
51-
5248
#define PyBytes_AsString PyString_AsString
5349
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
5450

55-
static inline char* PyString_AsUtf8AndSize(PyObject *obj, Py_ssize_t* length) {
56-
char* buffer = NULL;
57-
return (PyString_AsStringAndSize(obj, &buffer, length) < 0) ? (char*)(0) : buffer;
58-
}
59-
6051
static inline PyObject* PyCreateDummyObject(const char* name) {
6152
PyObject* tmp = Py_InitModule(name, NULL);
6253
Py_INCREF(tmp);

0 commit comments

Comments
 (0)