Skip to content

Add missing parentheses for python 3.10 compatibility#190

Merged
martinandersen merged 1 commit intocvxopt:masterfrom
jamesjer:parens
Sep 19, 2021
Merged

Add missing parentheses for python 3.10 compatibility#190
martinandersen merged 1 commit intocvxopt:masterfrom
jamesjer:parens

Conversation

@jamesjer
Copy link
Copy Markdown
Contributor

With python 3.10a6, the cvxopt build has started to fail, with errors such as this:

In file included from /usr/include/python3.10/Python.h:87,
                 from src/C/base.c:24:
src/C/base.c: In function ‘get_id’:
/usr/include/python3.10/object.h:242:38: error: expected ‘(’ before ‘_PyObject_TypeCheck’
  242 | #define PyObject_TypeCheck(ob, type) _PyObject_TypeCheck(_PyObject_CAST(ob), type)
      |                                      ^~~~~~~~~~~~~~~~~~~
src/C/cvxopt.h:73:28: note: in expansion of macro ‘PyObject_TypeCheck’
   73 | #define Matrix_Check(self) PyObject_TypeCheck(self, &matrix_tp)
      |                            ^~~~~~~~~~~~~~~~~~
src/C/base.c:356:8: note: in expansion of macro ‘Matrix_Check’
  356 |     if Matrix_Check((PyObject *)val)
      |        ^~~~~~~~~~~~
src/C/base.c:371:1: warning: control reaches end of non-void function [-Wreturn-type]
  371 | }
      | ^
error: command '/usr/bin/gcc' failed with exit code 1

Reminiscent of #164, the cause is an if expression that used to expand to a parenthesized expression, but no longer does.

@mkoeppe
Copy link
Copy Markdown

mkoeppe commented Sep 16, 2021

@martinandersen Any chance that this can be merged and a new release compatible with python 3.10 be cut?

sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Sep 16, 2021
sageb0t pushed a commit to sagemath/sagetrac-mirror that referenced this pull request Sep 16, 2021
@orlitzky
Copy link
Copy Markdown

FWIW the tentative python-3.10 release date is about three weeks from now: https://www.python.org/dev/peps/pep-0619/

@martinandersen
Copy link
Copy Markdown
Contributor

@mkoeppe Sure, I'll see if I can get to it on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants