Changeset 4041a6d for python/ext


Ignore:
Timestamp:
Apr 18, 2016, 10:48:53 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
2e4ae1d
Parents:
7c785e6 (diff), b8ed85e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge pull request #40 from nphilipp/develop--py3k-fixes

Miscellaneous fixes for Python, mostly version 3

Location:
python/ext
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • python/ext/aubio-types.h

    r7c785e6 r4041a6d  
    4040#endif
    4141
     42// compat with Python < 2.6
     43#ifndef Py_TYPE
     44#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
     45#endif
     46
    4247// special python type for cvec
    4348typedef struct
  • python/ext/aubiowraphell.h

    r7c785e6 r4041a6d  
    1414  self->o = new_aubio_## NAME ( PARAMS ); \
    1515  if (self->o == NULL) { \
    16     PyErr_SetString (PyExc_StandardError, "error creating object"); \
     16    PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
    1717    return -1; \
    1818  } \
     
    2626{ \
    2727  del_aubio_ ## NAME (self->o); \
    28   self->ob_type->tp_free ((PyObject *) self); \
     28  Py_TYPE(self)->tp_free ((PyObject *) self); \
    2929}
    3030
  • python/ext/py-cvec.c

    r7c785e6 r4041a6d  
    6060{
    6161  del_cvec (self->o);
    62   self->ob_type->tp_free ((PyObject *) self);
     62  Py_TYPE(self)->tp_free ((PyObject *) self);
    6363}
    6464
  • python/ext/py-filter.c

    r7c785e6 r4041a6d  
    5858  del_fvec(self->out);
    5959  del_aubio_filter (self->o);
    60   self->ob_type->tp_free ((PyObject *) self);
     60  Py_TYPE(self)->tp_free ((PyObject *) self);
    6161}
    6262
  • python/ext/py-sink.c

    r7c785e6 r4041a6d  
    116116  }
    117117  if (self->o == NULL) {
    118     PyErr_SetString (PyExc_StandardError, "error creating sink with this uri");
     118    PyErr_SetString (PyExc_RuntimeError, "error creating sink with this uri");
    119119    return -1;
    120120  }
  • python/ext/py-source.c

    r7c785e6 r4041a6d  
    140140    char_t errstr[30 + strlen(self->uri)];
    141141    sprintf(errstr, "error creating source with %s", self->uri);
    142     PyErr_SetString (PyExc_StandardError, errstr);
     142    PyErr_SetString (PyExc_RuntimeError, errstr);
    143143    return -1;
    144144  }
Note: See TracChangeset for help on using the changeset viewer.