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/rpmfd-py.c | |
parent | 33c569ce6fd827ba039e36ffe0a77b0643d0ac70 (diff) | |
download | rpm-1866fc41c8fdf5a82705cee7f1043d5fb634c3be.tar.gz rpm-1866fc41c8fdf5a82705cee7f1043d5fb634c3be.tar.bz2 rpm-1866fc41c8fdf5a82705cee7f1043d5fb634c3be.zip |
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/rpmfd-py.c')
-rw-r--r-- | python/rpmfd-py.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c index 62ddeb09e..8b0da0e6e 100644 --- a/python/rpmfd-py.c +++ b/python/rpmfd-py.c @@ -56,10 +56,10 @@ static PyObject *rpmfd_new(PyTypeObject *subtype, &fo, &mode, &flags)) return NULL; - if (PyString_Check(fo)) { + if (PyBytes_Check(fo)) { char *m = rstrscat(NULL, mode, ".", flags, NULL); Py_BEGIN_ALLOW_THREADS - fd = Fopen(PyString_AsString(fo), m); + fd = Fopen(PyBytes_AsString(fo), m); Py_END_ALLOW_THREADS free(m); } else if (PyInt_Check(fo)) { @@ -220,7 +220,7 @@ static PyObject *rpmfd_read(rpmfdObject *s, PyObject *args, PyObject *kwds) PyErr_SetString(PyExc_IOError, Fstrerror(s->fd)); goto exit; } - res = PyString_FromStringAndSize(buf, read); + res = PyBytes_FromStringAndSize(buf, read); exit: free(buf); |