Commit Graph

12 Commits

Author SHA1 Message Date
William S Fulton 5ead577916 Restore missing testing of python_pybuffer testcase
Previous commit stopped testing this testcase when Py_LIMITED_API < 3.11.

Add changes file entry for Py_LIMITED_API bug fix in previous few commits.
2025-12-04 06:42:02 +00:00
William S Fulton 05c439d1dd Add SWIG_PYTHON_OLD_BUFFER_PROTOCOL fragments for pybuffer typemaps
The pybuffer typemaps use a new fragment for issuing the helpful warning
to help clarify when the old Buffer Protocol can be used. This prevents
it being issued when the typemaps are not used and makes it clearer in
the generated code when the old Protocol Buffer is being used.

Define SWIG_NO_PYTHON_OLD_BUFFER_PROTOCOL to override the choice of when
to define SWIG_PYTHON_OLD_BUFFER_PROTOCOL.
2025-05-23 15:17:50 +01:00
William S Fulton 8710367043 Remove error which might break builds if pybuffer typemaps are not actually used 2025-05-23 15:17:50 +01:00
Julien Schueller f2a3e5306c Python/buffer: Warn about old protocol removal
Closes #3059
2025-05-23 15:17:50 +01:00
Julien Schueller fc2d3fbf5b Python/buffer: Prefer new protocol with Stable ABI
Use the new buffer protocol from stable abi 3.11
2025-05-23 15:17:50 +01:00
Vadim Zeitlin c1fd856fbd Make Python buffer typemaps compatible with limited API
Use deprecated PyObject_As{ReadmWrite}Buffer() functions instead of
PyObject_GetBuffer() not available in limited API. Even though these
functions are deprecated and are not supposed to be used, using them
should be fine for now (up to Python 3.8) and, hopefully, buffer API
will be stabilized before they are removed in a future Python version.
2022-02-04 01:37:57 +01:00
Zackery Spytz 772dfd5dcb Fix the error handling for the PyObject_GetBuffer() calls in pybuffer.i
Closes #1640.
2020-06-07 17:47:11 -06:00
William S Fulton 4313c2c168 Update pybuffer.i library to use new-style Python buffer C API.
Removed old API altogether as Python 2.7 is now the minimum version
supported and it supports the new-style buffer API.
2018-08-12 15:02:28 +01:00
Giacomo Mazzamuto 3594e54f7e pybuffer: don't use the old deprecated buffer protocol for Python 3 2018-07-05 00:29:28 +02:00
Haoyu Bai 03e840f3ec changed the mapped 'SIZE' of buffer interface from the length of raw buffer to number of items in the buffer. So it would be easier to use with type other than 'char'
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11125 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-02-10 14:21:43 +00:00
William S Fulton 7ec3c4ae81 minor typo and formatting improvements
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10868 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-18 20:16:50 +00:00
Haoyu Bai 3d8ddfc442 Merged the Python 3.0 support branch. The merging progress is not so smooth, so hope this commit won't make anything broken.
This is the (incomplemete) log produced by svnmerge.py:

Merged revisions 10405-10409,10420-10422,10426,10438,10445,10451,10454-10465,10467,10473-10475,10485,10488-10489,10493-10495,10497,10509-10510,10513-10514,10517,10520,10525,10528-10529,10533-10535,10554-10557,10570,10573,10593,10614,10666-10669,10673,10678,10687,10690,10704-10706,10731,10744,10750-10752,10755,10759,10770,10775-10776,10813,10819 via svnmerge from 
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-11 17:18:07 +00:00