From: Stefan Behnel Date: Tue, 10 Mar 2009 19:49:48 +0000 (+0100) Subject: fix (Py_s)size_t as argument type by removing old code that depended on PyArg_ParseTu... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1bf1536c88ecd13174947a165570b76379c082c7;p=cython.git fix (Py_s)size_t as argument type by removing old code that depended on PyArg_ParseTupleAndKeywords() --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 171151a3..7610204c 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1731,14 +1731,6 @@ class DefNode(FuncDefNode): (arg.type.is_extension_type or arg.type.is_builtin_type): arg.needs_type_test = 1 any_type_tests_needed = 1 - elif (arg.type is PyrexTypes.c_py_ssize_t_type - or arg.type is PyrexTypes.c_size_t_type): - # Don't use PyArg_ParseTupleAndKeywords's parsing - # Py_ssize_t: want to use __index__ rather than __int__ - # size_t: no Python format char - arg.needs_conversion = 1 - arg.hdr_type = PyrexTypes.py_object_type - arg.hdr_cname = Naming.arg_prefix + arg.name if any_type_tests_needed: env.use_utility_code(arg_type_test_utility_code) @@ -1943,14 +1935,6 @@ class DefNode(FuncDefNode): error(arg.pos, "Non-default argument following default argument") elif not arg.is_self_arg: positional_args.append(arg) - if arg.needs_conversion: - format = arg.hdr_type.parsetuple_format - else: - format = arg_entry.type.parsetuple_format - if not format: - error(arg.pos, - "Cannot convert Python object argument to type '%s' (when parsing input arguments)" - % arg.type) self.generate_tuple_and_keyword_parsing_code( positional_args, kw_only_args, end_label, code)