vBaiCai / python-pesq

A python package for calculating the PESQ.
MIT License
353 stars 69 forks source link

how do I make it apply to python2.7 #1

Closed amoxuk closed 5 years ago

amoxuk commented 5 years ago

first of all, i'm very glad to found this project and thanks for you contribution. but my envirment is python 2.7 and i found you project is depending on python 3+. so how do i make it apply to python 2.7? // this may be supported to python 3+, because when i run 'python setup.py install' and i got some errors : pypesq/pesq.c(21) : error C2079: 'pesqmodule' uses undefined struct 'PyModuleDef' pypesq/pesq.c(22) : error C2065: 'PyModuleDef_HEAD_INIT' : undeclared identifier pypesq/pesq.c(22) : error C2099: initializer is not a constant pypesq/pesq.c(23) : warning C4047: 'initializing' : 'int' differs in levels of indirection from 'char [10]' pypesq/pesq.c(24) : error C2078: too many initializers pypesq/pesq.c(31) : warning C4013: 'PyModule_Create' undefined; assuming extern returning int pypesq/pesq.c(31) : warning C4098: 'PyInit_pesq_core' : 'void' function returning a value pypesq/pesq.c(54) : error C2143: syntax error : missing ';' before 'type' pypesq/pesq.c(59) : error C2065: 'pesq' : undeclared identifier pypesq/pesq.c(60) : error C2065: 'pesq' : undeclared identifier

i found it at: static struct PyModuleDef pesqmodule = { PyModuleDef_HEAD_INIT, "pesq_core", module_docstring, -1, module_methods };

vBaiCai commented 5 years ago

Thanks for the bug report. This project is only tested under python 3; I will try to make it workable for python2 , later.

vBaiCai commented 5 years ago

@amoxuk I have fixed the compatibility problem.