2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 16:52:15 +00:00

Python 2.5 compatibility

[SVN r34017]
This commit is contained in:
Ralf W. Grosse-Kunstleve
2006-05-18 22:41:14 +00:00
parent 66ac61450e
commit caa9cb8268
9 changed files with 45 additions and 19 deletions

View File

@@ -64,7 +64,7 @@ function::function(
= max_arity > num_keywords ? max_arity - num_keywords : 0;
unsigned tuple_size = num_keywords ? max_arity : 0;
Py_ssize_t tuple_size = num_keywords ? max_arity : 0;
m_arg_names = object(handle<>(PyTuple_New(tuple_size)));
if (num_keywords != 0)
@@ -158,7 +158,9 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
else
{
// build a new arg tuple, will adjust its size later
inner_args = handle<>(PyTuple_New(max_arity));
assert(max_arity <= PY_SSIZE_T_MAX);
inner_args = handle<>(
PyTuple_New(static_cast<Py_ssize_t>(max_arity)));
// Fill in the positional arguments
for (std::size_t i = 0; i < n_unnamed_actual; ++i)
@@ -293,7 +295,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
% make_tuple(this->m_namespace, this->m_name);
list actual_args;
for (int i = 0; i < PyTuple_Size(args); ++i)
for (Py_ssize_t i = 0; i < PyTuple_Size(args); ++i)
{
char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name;
actual_args.append(str(name));