Skip to content

Commit

Permalink
Nullptr revert (#145)
Browse files Browse the repository at this point in the history
* cis: do not build wheels on 3.11 yet (betas are not ABI stable)

Alos update to setup-pythonv4

* Revert use of nullptr in PyTuple_SET_ITEM

This reverts commit 4a568b7fb6ef9996181013b960a18ceec56d8889, reversing
changes made to 13b6186.

* cis: force to use 3.11beta4 and update checkout action

* fix typo
  • Loading branch information
MatthieuDartiailh authored Jul 13, 2022
1 parent 081a5f4 commit c782d1d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
matrix:
python-version: ['3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
Expand All @@ -83,13 +83,13 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7', 'pypy-3.8', '3.11.0-beta - 3.11.0']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.x'
- name: Build sdist
run: |
pip install --upgrade pip
Expand Down Expand Up @@ -77,9 +77,9 @@ jobs:
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.x'
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.archs != 'auto'
uses: docker/setup-qemu-action@v1
Expand All @@ -102,7 +102,7 @@ jobs:
uses: pypa/[email protected]
if: matrix.manylinux_version == 'manylinux2010'
env:
CIBW_BUILD: "cp39-* cp310-* cp311-* pp37-*"
CIBW_BUILD: "cp39-* cp310-* pp37-*"
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_ARCHS_LINUX: ${{ matrix.archs }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
Expand Down
2 changes: 1 addition & 1 deletion py/src/symbolics.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ PyObject* BinaryMul::operator()( Expression* first, double second )
return 0;
Py_ssize_t end = PyTuple_GET_SIZE( first->terms );
for( Py_ssize_t i = 0; i < end; ++i ) // memset 0 for safe error return
PyTuple_SET_ITEM( terms.get(), i, nullptr );
PyTuple_SET_ITEM( terms.get(), i, 0 );
for( Py_ssize_t i = 0; i < end; ++i )
{
PyObject* item = PyTuple_GET_ITEM( first->terms, i );
Expand Down
2 changes: 1 addition & 1 deletion py/src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ make_terms( const std::map<PyObject*, double>& coeffs )
return 0;
Py_ssize_t size = PyTuple_GET_SIZE( terms.get() );
for( Py_ssize_t i = 0; i < size; ++i ) // zero tuple for safe early return
PyTuple_SET_ITEM( terms.get(), i, nullptr );
PyTuple_SET_ITEM( terms.get(), i, 0 );
Py_ssize_t i = 0;
iter_t it = coeffs.begin();
iter_t end = coeffs.end();
Expand Down

0 comments on commit c782d1d

Please sign in to comment.