}
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "WERROR") {
+ $self->pidl("if (PyTuple_Check($cvar)) {");
+ $self->indent;
+ $self->pidl("$cvar = PyTuple_GetItem($cvar, 0);");
+ $self->deindent;
+ $self->pidl("}");
+
+ $self->pidl("if (PyLong_Check($cvar)) {");
+ $self->indent;
+ $self->pidl("$target = W_ERROR(PyLong_AsLongLong($cvar));");
+ $self->deindent;
+ $self->pidl("} else if (PyInt_Check($cvar)) {");
+ $self->indent;
$self->pidl("$target = W_ERROR(PyInt_AsLong($cvar));");
+ $self->deindent;
+ $self->pidl("} else {");
+ $self->indent;
+ $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s or %s\",\\");
+ $self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, PyTuple_Type.tp_name);");
+ $self->pidl($fail);
+ $self->deindent;
+ $self->pidl("}");
+
+# $self->pidl("$target = W_ERROR(PyInt_AsLong($cvar));");
return;
}