Skip to content

Commit df56c7f

Browse files
Enable PY_SSIZE_T_CLEAN in order to avoid deprecation warning and/or segfault
under Python 3.8.0b1 (#317).
1 parent d8bde9c commit df56c7f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/cxoConnection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ static PyObject *cxoConnection_commit(cxoConnection *conn, PyObject *args)
11991199
//-----------------------------------------------------------------------------
12001200
static PyObject *cxoConnection_begin(cxoConnection *conn, PyObject *args)
12011201
{
1202-
uint32_t transactionIdLength, branchIdLength;
1202+
Py_ssize_t transactionIdLength, branchIdLength;
12031203
const char *transactionId, *branchId;
12041204
int formatId, status;
12051205

src/cxoModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// Include file for all cx_Oracle source files.
1010
//-----------------------------------------------------------------------------
1111

12+
#define PY_SSIZE_T_CLEAN 1
13+
1214
#include <Python.h>
1315
#include <structmember.h>
1416
#include <time.h>

src/cxoSessionPool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static PyObject *cxoSessionPool_acquire(cxoSessionPool *pool, PyObject *args,
332332
"tag", "matchanytag", "shardingkey", "supershardingkey", NULL };
333333
PyObject *createKeywordArgs, *result, *cclassObj, *purityObj, *tagObj;
334334
PyObject *shardingKeyObj, *superShardingKeyObj;
335-
unsigned usernameLength, passwordLength;
335+
Py_ssize_t usernameLength, passwordLength;
336336
char *username, *password;
337337
PyObject *matchAnyTagObj;
338338

0 commit comments

Comments
 (0)