scikit-learn-contrib / py-earth

A Python implementation of Jerome Friedman's Multivariate Adaptive Regression Splines
http://contrib.scikit-learn.org/py-earth/
BSD 3-Clause "New" or "Revised" License
455 stars 121 forks source link

Fix compiling for python 3.7, change exc_* to curexc_* #203

Open helllynx opened 4 years ago

helllynx commented 4 years ago

Hello! I try install py-earth on ArchLinux with Python 3.7.4, but when i execute next command:

sudo python setup.py install --cythonize

See next errors in console:

pyearth/_util.c: In function ‘__Pyx__ExceptionSave’:
pyearth/_util.c:8072:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 8072 |     *value = tstate->exc_value;
      |                      ^~~~~~~~~
      |                      curexc_value
pyearth/_util.c:8073:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 8073 |     *tb = tstate->exc_traceback;
      |                   ^~~~~~~~~~~~~
      |                   curexc_traceback
pyearth/_util.c: In function ‘__Pyx__ExceptionReset’:
pyearth/_util.c:8081:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 8081 |     tmp_value = tstate->exc_value;
      |                         ^~~~~~~~~
      |                         curexc_value
pyearth/_util.c:8082:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 8082 |     tmp_tb = tstate->exc_traceback;
      |                      ^~~~~~~~~~~~~
      |                      curexc_traceback
pyearth/_util.c:8084:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 8084 |     tstate->exc_value = value;
      |             ^~~~~~~~~
      |             curexc_value
pyearth/_util.c:8085:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 8085 |     tstate->exc_traceback = tb;
      |             ^~~~~~~~~~~~~
      |             curexc_traceback
pyearth/_util.c: In function ‘__Pyx__GetException’:
pyearth/_util.c:8141:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 8141 |     tmp_value = tstate->exc_value;
      |                         ^~~~~~~~~
      |                         curexc_value
pyearth/_util.c:8142:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 8142 |     tmp_tb = tstate->exc_traceback;
      |                      ^~~~~~~~~~~~~
      |                      curexc_traceback
pyearth/_util.c:8144:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
 8144 |     tstate->exc_value = local_value;
      |             ^~~~~~~~~
      |             curexc_value
pyearth/_util.c:8145:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
 8145 |     tstate->exc_traceback = local_tb;
      |             ^~~~~~~~~~~~~
      |             curexc_traceback

etc.

I just fixed all entries of wrong members and library was compiled successfully.