$self->pidl("}");
$self->pidl("$target = test_var;");
$self->deindent;
- $self->pidl("} else if (PyLong_Check($cvar)) {");
- $self->indent;
- $self->pidl("long test_var;");
- $self->pidl("test_var = PyInt_AsLong($cvar);");
- $self->pidl("if (test_var < 0 || (unsigned long long)test_var > uint_max) {");
- $self->indent;
- $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s or %s within range 0 - %llu, got %ld\",\\");
- $self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);");
- $self->pidl($fail);
- $self->deindent;
- $self->pidl("}");
- $self->pidl("$target = test_var;");
- $self->deindent;
$self->pidl("} else {");
$self->indent;
$self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s\",\\");
$self->pidl("}");
$self->pidl("$target = test_var;");
$self->deindent;
- $self->pidl("} else if (PyLong_Check($cvar)) {");
- $self->indent;
- $self->pidl("long test_var;");
- $self->pidl("test_var = PyInt_AsLong($cvar);");
- $self->pidl("if (test_var < int_min || test_var > int_max) {");
- $self->indent;
- $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s or %s within range %lld - %lld, got %ld\",\\");
- $self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);");
- $self->pidl($fail);
- $self->deindent;
- $self->pidl("}");
- $self->pidl("$target = test_var;");
- $self->deindent;
$self->pidl("} else {");
$self->indent;
$self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s\",\\");