diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-21 13:15:44 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-21 13:15:44 +0300 |
commit | 1866fc41c8fdf5a82705cee7f1043d5fb634c3be (patch) | |
tree | cb5d7f68633c1083d8afe016cb5ed2d5e6230b32 /python/rpmsystem-py.h | |
parent | 33c569ce6fd827ba039e36ffe0a77b0643d0ac70 (diff) | |
download | rpm-1866fc41c8fdf5a82705cee7f1043d5fb634c3be.tar.gz |
Replace PyString usage with PyBytes everywhere
- In Python 2.6 PyBytes is just an alias for PyString, Python 3.0
removed PyString entirely
- Add compatibility defines for Python < 2.6
- Based on David Malcolm's Python 3.x efforts
Diffstat (limited to 'python/rpmsystem-py.h')
-rw-r--r-- | python/rpmsystem-py.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index 35c0f4d0e..d4923ab64 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h @@ -25,5 +25,12 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #define Py_TYPE(o) ((o)->ob_type) #endif +#if ((PY_MAJOR_VERSION << 8) | (PY_MINOR_VERSION << 0)) < 0x0206 +#define PyXBytes_Check PyString_Check +#define PyXBytes_FromString PyString_FromString +#define PyXBytes_FromStringAndSize PyString_FromStringAndSize +#define PyXBytes_Size PyString_Size +#define PyXBytes_AsString PyString_AsString +#endif #endif /* H_SYSTEM_PYTHON */ |