Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Fix Python 3.11 support (#187)
Browse files Browse the repository at this point in the history
The compilation error on master is:
```
    ast3/Parser/tokenizer.c:1991:10: error: implicit declaration of function '_Py_dup' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        fd = _Py_dup(fd);
             ^
    1 error generated.
```
Probably as a result of python/cpython#30484

Just declaring it seems to fix things.

Add a (slightly) hacky way of testing Python 3.11 in CI prior to manylinux / cibuildwheel support.
  • Loading branch information
hauntsaninja authored Apr 30, 2022
1 parent f94be5d commit 2a02975
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ name: Build wheels
on: [push, pull_request]

jobs:
test_prerelease_python:
# needed because manylinux is hesitant to support pre-release python
# so we can't just use cibuildwheel
name: prelease python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11-dev'
- run: |
python3.11 -m pip install -e .
python3.11 -m pip install pytest
python3.11 -m pytest
build_wheels:
name: py${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions ast3/Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,8 @@ Ta3Tokenizer_Get(struct tok_state *tok, char **p_start, char **p_end)
The char* returned is malloc'ed via PyMem_MALLOC() and thus must be freed
by the caller. */

PyAPI_FUNC(int) _Py_dup(int fd);

char *
Ta3Tokenizer_FindEncodingFilename(int fd, PyObject *filename)
{
Expand Down

0 comments on commit 2a02975

Please # to comment.