Commit b038333d authored by Neal Norwitz's avatar Neal Norwitz

Handle ssize_t

No need to INCREF then let PyString_ConcatAndDel() DECREF.  Just
use PyString_Concat().
Handle error condition if we can't concat.
parent 5102c4e3
...@@ -1271,7 +1271,7 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject ...@@ -1271,7 +1271,7 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
PyObject *name = PyTuple_GET_ITEM(args, 0); PyObject *name = PyTuple_GET_ITEM(args, 0);
PyObject *swapped_args; PyObject *swapped_args;
static PyObject *suffix; static PyObject *suffix;
int i; Py_ssize_t i;
swapped_args = PyTuple_New(PyTuple_GET_SIZE(args)); swapped_args = PyTuple_New(PyTuple_GET_SIZE(args));
if (!swapped_args) if (!swapped_args)
...@@ -1284,8 +1284,9 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject ...@@ -1284,8 +1284,9 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
suffix = PyString_FromString("_be"); suffix = PyString_FromString("_be");
#endif #endif
Py_INCREF(suffix); PyString_Concat(&name, suffix);
PyString_ConcatAndDel(&name, suffix); if (name == NULL)
return NULL;
PyTuple_SET_ITEM(swapped_args, 0, name); PyTuple_SET_ITEM(swapped_args, 0, name);
for (i=1; i<PyTuple_GET_SIZE(args); ++i) { for (i=1; i<PyTuple_GET_SIZE(args); ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment