Skip to content

bindings/python: Drop Python 2 integer API usage - #303

Open
daeho-ro wants to merge 1 commit into
sigrokproject:masterfrom
daeho-ro:python-bindings-swig-4.5
Open

daeho-ro wants to merge 1 commit into
sigrokproject:masterfrom
daeho-ro:python-bindings-swig-4.5

Conversation

@daeho-ro

Copy link
Copy Markdown

SWIG 4.5.0 removed the Python 2 compatibility macros it used to emit into the generated wrapper, so PyInt_Check() and PyInt_AsLong() are no longer defined.

SWIG 4.5.0 removed the Python 2 compatibility macros it used to emit
into the generated wrapper, so PyInt_Check() and PyInt_AsLong() are no
longer defined and the Python bindings fail to compile:

  sigrok/core/classes_wrap.cpp: error: use of undeclared identifier 'PyInt_Check'

Python 3 only has PyLong, which the typemaps already handle, so use
PyLong_Check() and PyLong_AsLong() everywhere and drop the branches
that only existed to accept Python 2 int objects.
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.

1 participant