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

Update the logic for extending the buffer in the writer #20

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ jobs:
env:
CIBW_ARCHS: auto64
CIBW_ARCHS_MACOS: "x86_64 universal2"
# skip 3.6 on all platforms; skip pypy for windows
CIBW_SKIP: cp36-* pp*-win_amd64
# Skip
#
# * Python 3.6 on all platforms,
# * Python 3.12 on all platforms, and
# * PyPy on Windows.
#
# TODO: Activate Python 3.12 when issue 18 is resolved.
CIBW_SKIP: cp36-* cp312-* pp*-win_amd64
steps:
- uses: actions/checkout@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions src/openstep_plist/writer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ from cpython.unicode cimport (
)
from cpython.bytes cimport PyBytes_GET_SIZE
from cpython.object cimport Py_SIZE
from libcpp.algorithm cimport copy
from libcpp.iterator cimport back_inserter
from libcpp.vector cimport vector
from libc.stdint cimport uint16_t
cimport cython
Expand Down Expand Up @@ -163,7 +161,7 @@ cdef class Writer:
self, const Py_UNICODE *s, Py_ssize_t length
) except +:
self.dest.reserve(self.dest.size() + length)
copy(s, s + length, back_inserter(self.dest[0]))
self.dest.insert(self.dest.end(), s, s + length)
return length

cdef inline unicode _getvalue(self):
Expand Down
Loading