Changeset 2e4ae1d
- Timestamp:
- Apr 18, 2016, 10:52:00 PM (9 years ago)
- 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:
- 5c1200a
- Parents:
- 4041a6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/aubiomodule.c
r4041a6d r2e4ae1d 249 249 }; 250 250 251 PyMODINIT_FUNC 252 init_aubio (void) 253 { 254 PyObject *m; 251 #if PY_MAJOR_VERSION >= 3 252 // Python3 module definition 253 static struct PyModuleDef moduledef = { 254 PyModuleDef_HEAD_INIT, 255 "_aubio", /* m_name */ 256 aubio_module_doc, /* m_doc */ 257 -1, /* m_size */ 258 aubio_methods, /* m_methods */ 259 NULL, /* m_reload */ 260 NULL, /* m_traverse */ 261 NULL, /* m_clear */ 262 NULL, /* m_free */ 263 }; 264 #endif 265 266 static PyObject * 267 initaubio (void) 268 { 269 PyObject *m = NULL; 255 270 int err; 256 271 … … 266 281 || (generated_types_ready() < 0 ) 267 282 ) { 268 return; 269 } 270 283 return m; 284 } 285 286 #if PY_MAJOR_VERSION >= 3 287 m = PyModule_Create(&moduledef); 288 #else 271 289 m = Py_InitModule3 ("_aubio", aubio_methods, aubio_module_doc); 290 #endif 272 291 273 292 if (m == NULL) { 274 return ;293 return m; 275 294 } 276 295 … … 301 320 // add ufunc 302 321 add_ufuncs(m); 303 } 322 323 return m; 324 } 325 326 #if PY_MAJOR_VERSION >= 3 327 // Python3 init 328 PyMODINIT_FUNC PyInit__aubio(void) 329 { 330 return initaubio(); 331 } 332 #else 333 // Python 2 init 334 PyMODINIT_FUNC init_aubio(void) 335 { 336 initaubio(); 337 } 338 #endif
Note: See TracChangeset
for help on using the changeset viewer.