Changeset 5c1200a for python


Ignore:
Timestamp:
Apr 18, 2016, 10:53:24 PM (9 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:
0e59ae0
Parents:
2e4ae1d
Message:

python/ext: continue preparing for python 3

Location:
python/ext
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • python/ext/aubiowraphell.h

    r2e4ae1d r5c1200a  
    4444#define AUBIO_TYPEOBJECT(NAME, PYNAME) \
    4545PyTypeObject Py_ ## NAME ## Type = { \
    46   PyObject_HEAD_INIT (NULL)    \
    47   0,                           \
     46  PyVarObject_HEAD_INIT (NULL, 0) \
    4847  PYNAME,                      \
    4948  sizeof (Py_ ## NAME),          \
  • python/ext/py-cvec.c

    r2e4ae1d r5c1200a  
    7070  PyObject *result = NULL;
    7171
    72   format = PyString_FromString ("aubio cvec of %d elements");
     72  format = PyUnicode_FromString ("aubio cvec of %d elements");
    7373  if (format == NULL) {
    7474    goto fail;
     
    8181  cvec_print ( self->o );
    8282
    83   result = PyString_Format (format, args);
     83  result = PyUnicode_Format (format, args);
    8484
    8585fail:
     
    261261
    262262PyTypeObject Py_cvecType = {
    263   PyObject_HEAD_INIT (NULL)
    264   0,                            /* ob_size           */
     263  PyVarObject_HEAD_INIT(NULL, 0)
    265264  "aubio.cvec",                 /* tp_name           */
    266265  sizeof (Py_cvec),             /* tp_basicsize      */
  • python/ext/py-fft.c

    r2e4ae1d r5c1200a  
    5151    char_t errstr[30];
    5252    sprintf(errstr, "error creating fft with win_s=%d", self->win_s);
    53     PyErr_SetString (PyExc_StandardError, errstr);
     53    PyErr_SetString (PyExc_Exception, errstr);
    5454    return -1;
    5555  }
     
    6666  del_cvec(self->out);
    6767  del_fvec(self->rout);
    68   self->ob_type->tp_free((PyObject *) self);
     68  Py_TYPE(self)->tp_free((PyObject *) self);
    6969}
    7070
  • python/ext/py-filter.c

    r2e4ae1d r5c1200a  
    163163
    164164PyTypeObject Py_filterType = {
    165   PyObject_HEAD_INIT (NULL)
    166   0,                            /* ob_size           */
     165  PyVarObject_HEAD_INIT(NULL, 0)
    167166  "aubio.digital_filter",       /* tp_name           */
    168167  sizeof (Py_filter),           /* tp_basicsize      */
  • python/ext/py-filterbank.c

    r2e4ae1d r5c1200a  
    6060    sprintf(errstr, "error creating filterbank with n_filters=%d, win_s=%d",
    6161        self->n_filters, self->win_s);
    62     PyErr_SetString (PyExc_StandardError, errstr);
     62    PyErr_SetString (PyExc_RuntimeError, errstr);
    6363    return -1;
    6464  }
     
    7373  del_aubio_filterbank(self->o);
    7474  del_fvec(self->out);
    75   self->ob_type->tp_free((PyObject *) self);
     75  Py_TYPE(self)->tp_free((PyObject *) self);
    7676}
    7777
  • python/ext/py-phasevoc.c

    r2e4ae1d r5c1200a  
    7171  del_cvec(self->output);
    7272  del_fvec(self->routput);
    73   self->ob_type->tp_free((PyObject *) self);
     73  Py_TYPE(self)->tp_free((PyObject *) self);
    7474}
    7575
  • python/ext/py-source.c

    r2e4ae1d r5c1200a  
    160160  del_fvec(self->read_to);
    161161  del_fmat(self->mread_to);
    162   self->ob_type->tp_free((PyObject *) self);
     162  Py_TYPE(self)->tp_free((PyObject *) self);
    163163}
    164164
     
    187187  PyObject *outputs = PyList_New(0);
    188188  PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (self->read_to));
    189   PyList_Append( outputs, (PyObject *)PyInt_FromLong (read));
     189  PyList_Append( outputs, (PyObject *)PyLong_FromLong(read));
    190190  return outputs;
    191191}
     
    214214  PyObject *outputs = PyList_New(0);
    215215  PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (self->mread_to));
    216   PyList_Append( outputs, (PyObject *)PyInt_FromLong (read));
     216  PyList_Append( outputs, (PyObject *)PyLong_FromLong(read));
    217217  return outputs;
    218218}
     
    234234{
    235235  uint_t tmp = aubio_source_get_samplerate (self->o);
    236   return (PyObject *)PyInt_FromLong (tmp);
     236  return (PyObject *)PyLong_FromLong (tmp);
    237237}
    238238
     
    241241{
    242242  uint_t tmp = aubio_source_get_channels (self->o);
    243   return (PyObject *)PyInt_FromLong (tmp);
     243  return (PyObject *)PyLong_FromLong (tmp);
    244244}
    245245
Note: See TracChangeset for help on using the changeset viewer.