Skip to content

Commit

Permalink
Merge pull request #1671 from chrisburr/patch-5
Browse files Browse the repository at this point in the history
Fix Python 3.10+ issues from PY_SSIZE_T_CLEAN not being set
  • Loading branch information
simonmichal committed Apr 20, 2022
2 parents 5160b45 + c5bb116 commit cbe1b62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions bindings/python/src/PyXRootD.hh
Expand Up @@ -25,6 +25,7 @@
#ifndef PYXROOTD_HH_
#define PYXROOTD_HH_

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <string>
#include "structmember.h"
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/PyXRootDFile.cc
Expand Up @@ -424,7 +424,7 @@ namespace PyXRootD
static const char *kwlist[] = { "buffer", "offset", "size", "timeout",
"callback", NULL };
const char *buffer;
int buffsize;
Py_ssize_t buffsize;
uint64_t offset = 0;
uint32_t size = 0;
uint16_t timeout = 0;
Expand Down Expand Up @@ -641,7 +641,7 @@ namespace PyXRootD
{
static const char *kwlist[] = { "arg", "timeout", "callback", NULL };
const char *buffer = 0;
int buffSize = 0;
Py_ssize_t buffSize = 0;
uint16_t timeout = 0;
PyObject *callback = NULL, *pystatus = NULL, *pyresponse = NULL;
XrdCl::XRootDStatus status;
Expand Down

0 comments on commit cbe1b62

Please sign in to comment.