Skip to content

Commit dc6aaf6

Browse files
authored
Merge pull request #98 from ShaneHarvey/fix-PY_SSIZE_T_CLEAN
Fix Python 3.8+ DeprecationWarning: PY_SSIZE_T_CLEAN will be required for # formats
2 parents 602e9c1 + 22a6cb1 commit dc6aaf6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ python:
55
- "2.7"
66
- "3.5"
77
- "3.6"
8+
- "3.7"
9+
- "3.8"
810
- "pypy"
911
- "pypy3"
1012
matrix:

snappy/snappymodule.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2626
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
*/
28+
#define PY_SSIZE_T_CLEAN
2829
#include "Python.h"
2930
#include <string.h>
3031
#include <stdio.h>
@@ -184,7 +185,7 @@ static PyObject *
184185
snappy__is_valid_compressed_buffer(PyObject *self, PyObject *args)
185186
{
186187
const char * compressed;
187-
int comp_size;
188+
Py_ssize_t comp_size;
188189
snappy_status status;
189190

190191
#if PY_MAJOR_VERSION >=3

0 commit comments

Comments
 (0)