summaryrefslogtreecommitdiff
path: root/ext/_yaml.h
blob: 3583e01ff082ccf0ee5e58c0d2e0c75042de18df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#include <yaml.h>

#if PY_MAJOR_VERSION < 3

#define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), 'strict')

#else

#define PyString_CheckExact PyBytes_CheckExact
#define PyString_AS_STRING  PyBytes_AS_STRING
#define PyString_GET_SIZE   PyBytes_GET_SIZE
#define PyString_FromStringAndSize  PyBytes_FromStringAndSize

#endif