fix (Py_s)size_t as argument type by removing old code that depended on PyArg_ParseTu...
authorStefan Behnel <scoder@users.berlios.de>
Tue, 10 Mar 2009 19:49:48 +0000 (20:49 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 10 Mar 2009 19:49:48 +0000 (20:49 +0100)
Cython/Compiler/Nodes.py

index 171151a3688215f56f29f2add6e36de2cff9901a..7610204c0f94d8f87e0941c603a77846d43d3ca9 100644 (file)
@@ -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)