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

Commit 2a02975

Browse files
authored
Fix Python 3.11 support (#187)
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.
1 parent f94be5d commit 2a02975

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ name: Build wheels
33
on: [push, pull_request]
44

55
jobs:
6+
test_prerelease_python:
7+
# needed because manylinux is hesitant to support pre-release python
8+
# so we can't just use cibuildwheel
9+
name: prelease python
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.11-dev'
16+
- run: |
17+
python3.11 -m pip install -e .
18+
python3.11 -m pip install pytest
19+
python3.11 -m pytest
20+
621
build_wheels:
722
name: py${{ matrix.python-version }} on ${{ matrix.os }}
823
runs-on: ${{ matrix.os }}

ast3/Parser/tokenizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,8 @@ Ta3Tokenizer_Get(struct tok_state *tok, char **p_start, char **p_end)
19801980
The char* returned is malloc'ed via PyMem_MALLOC() and thus must be freed
19811981
by the caller. */
19821982

1983+
PyAPI_FUNC(int) _Py_dup(int fd);
1984+
19831985
char *
19841986
Ta3Tokenizer_FindEncodingFilename(int fd, PyObject *filename)
19851987
{

0 commit comments

Comments
 (0)