Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on Python 3 with errors about PyInt_AS_LONG (with certain compiler options) #10

Open
jamadden opened this issue Apr 30, 2021 · 0 comments · May be fixed by #11
Open

Fails to build on Python 3 with errors about PyInt_AS_LONG (with certain compiler options) #10

jamadden opened this issue Apr 30, 2021 · 0 comments · May be fixed by #11

Comments

@jamadden
Copy link
Contributor

jamadden commented Apr 30, 2021

The compiler produces these errors:

    zopyx/txng3/ext/python-Levenshtein-0.10/Levenshtein.c:1374:27: error: implicit declaration of function 'PyInt_AS_LONG' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ops[i].spos = (size_t)PyInt_AS_LONG(item);
                              ^
    zopyx/txng3/ext/python-Levenshtein-0.10/Levenshtein.c:1416:28: error: implicit declaration of function 'PyInt_AS_LONG' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        bops[i].sbeg = (size_t)PyInt_AS_LONG(item);
                               ^
    zopyx/txng3/ext/python-Levenshtein-0.10/Levenshtein.c:1487:20: error: implicit declaration of function 'PyInt_AS_LONG' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        long int len = PyInt_AS_LONG(object);

PyInt_AS_LONG was removed in Python 3; the replacement is PyLong_AS_LONG, which is just a define for the function call PyLong_AsLong(op).

When I did the initial port to Python 3, these would have been logged as warnings (which of course pip hides), but they do mean that uses of the function (module?) that contain them would fail. I was using a different compiler here (ccache) that explicitly asked for those warnings to be errors.

jamadden added a commit to NextThought/zopyx.txng3.ext that referenced this issue May 20, 2021
Fixes zopyx#10.

This updates the package to use the new-in-Python-3 unicode APIs when available.
@jamadden jamadden linked a pull request May 20, 2021 that will close this issue
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 a pull request may close this issue.

1 participant