replace PyInt_CheckExact with PyInt_Check, same for floats and strings so subclass and C/subtypes work.
was reported as a bug a while ago.
This commit is contained in:
@@ -413,7 +413,7 @@ static int BezTriple_setHandles( BPy_BezTriple * self, PyObject *args )
|
||||
ob1 = PySequence_ITEM( args, 0 );
|
||||
ob2 = PySequence_ITEM( args, 1 );
|
||||
|
||||
if( !PyInt_CheckExact( ob1 ) || !PyInt_CheckExact( ob2 ) ) {
|
||||
if( !PyInt_Check( ob1 ) || !PyInt_Check( ob2 ) ) {
|
||||
Py_DECREF( ob1 );
|
||||
Py_DECREF( ob2 );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
|
||||
@@ -652,7 +652,7 @@ static int Camera_setMode( BPy_Camera * self, PyObject * value )
|
||||
{
|
||||
unsigned int flag = 0;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected an integer (bitmask) as argument" );
|
||||
|
||||
|
||||
@@ -1401,7 +1401,7 @@ static PyObject *Constraint_getData( BPy_Constraint * self, PyObject * key )
|
||||
{
|
||||
int setting;
|
||||
|
||||
if( !PyInt_CheckExact( key ) )
|
||||
if( !PyInt_Check( key ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"expected an int arg" );
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ static int Group_setLayers( BPy_Group * self, PyObject * value )
|
||||
|
||||
GROUP_DEL_CHECK_INT(self);
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected an integer (bitmask) as argument" );
|
||||
|
||||
|
||||
@@ -811,7 +811,7 @@ static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
|
||||
|
||||
static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
|
||||
{
|
||||
if( !PyInt_CheckExact( args ) )
|
||||
if( !PyInt_Check( args ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ static int IpoCurve_setDriver( C_IpoCurve * self, PyObject * args )
|
||||
{
|
||||
IpoCurve *ipo = self->ipocurve;
|
||||
int type;
|
||||
if( !PyInt_CheckExact( args ) )
|
||||
if( !PyInt_Check( args ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument 0 or 1 " );
|
||||
|
||||
@@ -879,7 +879,7 @@ static int IpoCurve_setDriverChannel( C_IpoCurve * self, PyObject * args )
|
||||
return EXPP_ReturnIntError( PyExc_RuntimeError,
|
||||
"This IpoCurve does not have an active driver" );
|
||||
|
||||
if( !PyInt_CheckExact( args ) )
|
||||
if( !PyInt_Check( args ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
|
||||
@@ -988,7 +988,7 @@ static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
|
||||
| EXPP_LAMP_MODE_NOSPECULAR
|
||||
| EXPP_LAMP_MODE_SHAD_RAY;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check ( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
|
||||
@@ -1764,7 +1764,7 @@ static int Material_setMode( BPy_Material * self, PyObject * value )
|
||||
{
|
||||
int param;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%08x", MA_MODE_MASK );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
|
||||
@@ -1358,15 +1358,15 @@ static PyObject *Mesh_setProperty_internal(CustomData *data, int eindex, PyObjec
|
||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||
"error, maximum name length is 31" );
|
||||
|
||||
if(PyInt_CheckExact(val)){
|
||||
if(PyInt_Check(val)){
|
||||
type = CD_PROP_INT;
|
||||
i = (int)PyInt_AS_LONG(val);
|
||||
}
|
||||
else if(PyFloat_CheckExact(val)){
|
||||
else if(PyFloat_Check(val)){
|
||||
type = CD_PROP_FLT;
|
||||
f = (float)PyFloat_AsDouble(val);
|
||||
}
|
||||
else if(PyString_CheckExact(val)){
|
||||
else if(PyString_Check(val)){
|
||||
type = CD_PROP_STR;
|
||||
s = PyString_AsString(val);
|
||||
}
|
||||
@@ -2085,7 +2085,7 @@ static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
|
||||
"MVert belongs to a different mesh" );
|
||||
}
|
||||
index = ((BPy_MVert*)tmp)->index;
|
||||
} else if( PyInt_CheckExact( tmp ) ) {
|
||||
} else if( PyInt_Check( tmp ) ) {
|
||||
index = PyInt_AsLong ( tmp );
|
||||
} else {
|
||||
MEM_freeN( vert_table );
|
||||
@@ -2396,7 +2396,7 @@ static int MEdge_setFlag( BPy_MEdge * self, PyObject * value )
|
||||
if( !edge )
|
||||
return -1;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check ( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -3020,7 +3020,7 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
|
||||
ok = 0;
|
||||
for( j = 0; ok == 0 && j < nverts; ++j ) {
|
||||
PyObject *item = PySequence_ITEM( tmp, j );
|
||||
if( !PyInt_CheckExact( item ) )
|
||||
if( !PyInt_Check( item ) )
|
||||
ok = 1;
|
||||
else {
|
||||
int index = PyInt_AsLong ( item );
|
||||
@@ -3254,7 +3254,7 @@ static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
|
||||
PyObject *tmp = PySequence_GetItem( args, i );
|
||||
if( BPy_MEdge_Check( tmp ) )
|
||||
edge_table[i] = ((BPy_MEdge *)tmp)->index;
|
||||
else if( PyInt_CheckExact( tmp ) )
|
||||
else if( PyInt_Check( tmp ) )
|
||||
edge_table[i] = PyInt_AsLong ( tmp );
|
||||
else {
|
||||
MEM_freeN( edge_table );
|
||||
@@ -3464,7 +3464,7 @@ static PyObject *MEdgeSeq_collapse( BPy_MEdgeSeq * self, PyObject *args )
|
||||
tmp1 = PySequence_GetItem( tmp, 0 );
|
||||
tmp2 = PySequence_GetItem( tmp, 1 );
|
||||
Py_DECREF( tmp );
|
||||
if( !(BPy_MEdge_Check( tmp1 ) || PyInt_CheckExact( tmp1 )) ||
|
||||
if( !(BPy_MEdge_Check( tmp1 ) || PyInt_Check( tmp1 )) ||
|
||||
!VectorObject_Check ( tmp2 ) ) {
|
||||
MEM_freeN( edge_table );
|
||||
MEM_freeN( vert_list );
|
||||
@@ -3476,7 +3476,7 @@ static PyObject *MEdgeSeq_collapse( BPy_MEdgeSeq * self, PyObject *args )
|
||||
}
|
||||
|
||||
/* store edge index, new vertex location */
|
||||
if( PyInt_CheckExact( tmp1 ) )
|
||||
if( PyInt_Check( tmp1 ) )
|
||||
edge_table[i] = PyInt_AsLong ( tmp1 );
|
||||
else
|
||||
edge_table[i] = ((BPy_MEdge *)tmp1)->index;
|
||||
@@ -4114,7 +4114,7 @@ static int MFace_setFlag( BPy_MFace *self, PyObject *value )
|
||||
if( !MFace_get_pointer( self ) )
|
||||
return -1;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check ( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%04x", MFACE_FLAG_BITMASK );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -4180,7 +4180,7 @@ static int MFace_setMode( BPy_MFace *self, PyObject *value )
|
||||
if( !MFace_get_pointer( self ) )
|
||||
return -1;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check ( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -4387,7 +4387,7 @@ static int MFace_setUVSel( BPy_MFace * self, PyObject * value )
|
||||
mask = TF_SEL1;
|
||||
for( i=0; i<length; ++i, mask <<= 1 ) {
|
||||
PyObject *tmp = PySequence_GetItem( value, i ); /* adds a reference, remove below */
|
||||
if( !PyInt_CheckExact( tmp ) ) {
|
||||
if( !PyInt_Check( tmp ) ) {
|
||||
Py_DECREF(tmp);
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected a tuple of integers" );
|
||||
@@ -5370,7 +5370,7 @@ static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args )
|
||||
PyObject *tmp = PySequence_GetItem( args, i );
|
||||
if( BPy_MFace_Check( tmp ) )
|
||||
face_table[i] = ((BPy_MFace *)tmp)->index;
|
||||
else if( PyInt_CheckExact( tmp ) )
|
||||
else if( PyInt_Check( tmp ) )
|
||||
face_table[i] = PyInt_AsLong( tmp );
|
||||
else {
|
||||
MEM_freeN( face_table );
|
||||
@@ -5948,7 +5948,7 @@ static PyObject *Mesh_findEdges( PyObject * self, PyObject *args )
|
||||
}
|
||||
index1 = v1->index;
|
||||
index2 = v2->index;
|
||||
} else if( PyInt_CheckExact( v1 ) && PyInt_CheckExact( v2 ) ) {
|
||||
} else if( PyInt_Check( v1 ) && PyInt_Check( v2 ) ) {
|
||||
index1 = PyInt_AsLong( (PyObject *)v1 );
|
||||
index2 = PyInt_AsLong( (PyObject *)v2 );
|
||||
if( (int)index1 >= mesh->totvert
|
||||
@@ -7030,7 +7030,7 @@ static PyObject *Mesh_getMultires( BPy_Mesh * self, void *type )
|
||||
static int Mesh_setMultires( BPy_Mesh * self, PyObject *value, void *type )
|
||||
{
|
||||
int i;
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected integer argument" );
|
||||
|
||||
@@ -7758,7 +7758,7 @@ static int Mesh_setMode( BPy_Mesh *self, PyObject *value )
|
||||
ME_UVEFFECT | ME_VCOLEFFECT | ME_AUTOSMOOTH | ME_SMESH |
|
||||
ME_SUBSURF | ME_OPT_EDGES;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check ( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -7816,7 +7816,7 @@ static int Mesh_setActiveFace( BPy_Mesh * self, PyObject * value )
|
||||
|
||||
/* if param isn't an int, error */
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected an int argument" );
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ static int Metaball_setUpdate( BPy_Metaball * self, PyObject * value )
|
||||
{
|
||||
|
||||
int param;
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"metaball.update - expected an int argument" );
|
||||
|
||||
@@ -752,7 +752,7 @@ static PyObject *Metaelem_getType( BPy_Metaelem *self )
|
||||
static int Metaelem_setType( BPy_Metaelem * self, PyObject * value )
|
||||
{
|
||||
int type;
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"metaelem.type - expected an integer (bitmask) as argument" );
|
||||
|
||||
|
||||
@@ -987,7 +987,7 @@ static PyObject *Modifier_getData( BPy_Modifier * self, PyObject * key )
|
||||
{
|
||||
int setting;
|
||||
|
||||
if( !PyInt_CheckExact( key ) )
|
||||
if( !PyInt_Check( key ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"expected an int arg as stored in Blender.Modifier.Settings" );
|
||||
|
||||
|
||||
@@ -3657,7 +3657,7 @@ static int setIntAttrRange( BPy_Object *self, PyObject *value, void *type )
|
||||
struct Object *object = self->object;
|
||||
int min, max, size;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected integer argument" );
|
||||
|
||||
@@ -4296,7 +4296,7 @@ static int Object_setLayersMask( BPy_Object *self, PyObject *value )
|
||||
int layers = 0, local;
|
||||
Base *base;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected an integer (bitmask) as argument" );
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ static int Scene_setLayerMask( BPy_Scene * self, PyObject * value )
|
||||
|
||||
SCENE_DEL_CHECK_INT(self);
|
||||
|
||||
if (!PyInt_CheckExact(value)) {
|
||||
if (!PyInt_Check(value)) {
|
||||
return EXPP_ReturnIntError( PyExc_AttributeError,
|
||||
"expected an integer (bitmask) as argument" );
|
||||
}
|
||||
|
||||
@@ -1530,7 +1530,7 @@ static int Texture_setFlags( BPy_Texture * self, PyObject * value )
|
||||
| TEX_CHECKER_ODD
|
||||
| TEX_CHECKER_EVEN;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%08x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -1602,7 +1602,7 @@ static int Texture_setImageFlags( BPy_Texture * self, PyObject * value,
|
||||
| TEX_CALCALPHA
|
||||
| TEX_NORMALMAP;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr , "expected int bitmask of 0x%08x", bitmask );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -1674,7 +1674,7 @@ static int Texture_setNoiseBasis( BPy_Texture * self, PyObject * value )
|
||||
{
|
||||
int param;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int (see 'Noise' constant dictionary)" );
|
||||
|
||||
@@ -1700,7 +1700,7 @@ static int Texture_setNoiseBasis2( BPy_Texture * self, PyObject * value,
|
||||
|
||||
if( (int)type == EXPP_TEX_NOISEBASIS2 ) {
|
||||
int param;
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int (see 'Noise' constant dictionary)" );
|
||||
|
||||
@@ -1720,7 +1720,7 @@ static int Texture_setNoiseBasis2( BPy_Texture * self, PyObject * value,
|
||||
*/
|
||||
|
||||
} else {
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int value of 1" );
|
||||
|
||||
@@ -1772,7 +1772,7 @@ static int Texture_setSType( BPy_Texture * self, PyObject * value )
|
||||
short param;
|
||||
const char *dummy = NULL;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ static PyObject *World_getSkytype( BPy_World * self )
|
||||
|
||||
static int World_setSkytype( BPy_World * self, PyObject * value )
|
||||
{
|
||||
if( !PyInt_CheckExact(value) )
|
||||
if( !PyInt_Check(value) )
|
||||
return ( EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" ) );
|
||||
self->world->skytype = (short)PyInt_AsLong(value);
|
||||
@@ -606,7 +606,7 @@ static PyObject *World_getMode( BPy_World * self )
|
||||
|
||||
static int World_setMode( BPy_World * self, PyObject * value )
|
||||
{
|
||||
if( !PyInt_CheckExact(value) )
|
||||
if( !PyInt_Check(value) )
|
||||
return ( EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" ) );
|
||||
self->world->mode = (short)PyInt_AsLong(value);
|
||||
@@ -640,7 +640,7 @@ static PyObject *World_getMistype( BPy_World * self )
|
||||
|
||||
static int World_setMistype( BPy_World * self, PyObject * value )
|
||||
{
|
||||
if( !PyInt_CheckExact(value) )
|
||||
if( !PyInt_Check(value) )
|
||||
return ( EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" ) );
|
||||
self->world->mistype = (short)PyInt_AsLong(value);
|
||||
|
||||
@@ -638,7 +638,7 @@ int EXPP_setIValueClamped( PyObject *value, void *param,
|
||||
{
|
||||
int number;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) ) {
|
||||
if( !PyInt_Check( value ) ) {
|
||||
char errstr[128];
|
||||
sprintf ( errstr, "expected int argument in [%d,%d]", min, max );
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
@@ -729,7 +729,7 @@ int EXPP_setIValueRange( PyObject *value, void *param,
|
||||
|
||||
sprintf ( errstr, "expected int argument in [%d,%d]", min, max );
|
||||
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check ( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
|
||||
number = PyInt_AS_LONG( value );
|
||||
|
||||
@@ -694,7 +694,7 @@ static int RenderData_setOSALevel( BPy_RenderData * self,
|
||||
{
|
||||
int level;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
@@ -925,7 +925,7 @@ static int RenderData_setRenderer( BPy_RenderData * self, PyObject * value )
|
||||
{
|
||||
int type;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected constant INTERNAL or YAFRAY" );
|
||||
|
||||
@@ -956,7 +956,7 @@ static int RenderData_setImageType( BPy_RenderData *self, PyObject *value )
|
||||
{
|
||||
int type;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int constant" );
|
||||
|
||||
@@ -1951,7 +1951,7 @@ static int RenderData_setMode( BPy_RenderData* self, PyObject *arg )
|
||||
{
|
||||
int value;
|
||||
|
||||
if( !PyInt_CheckExact( arg ) )
|
||||
if( !PyInt_Check( arg ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
@@ -1987,7 +1987,7 @@ static int RenderData_setSceMode( BPy_RenderData* self, PyObject *arg )
|
||||
{
|
||||
int value;
|
||||
|
||||
if( !PyInt_CheckExact( arg ) )
|
||||
if( !PyInt_Check( arg ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError,
|
||||
"expected int argument" );
|
||||
|
||||
@@ -2102,7 +2102,7 @@ static int RenderData_setImagePlanes( BPy_RenderData *self, PyObject *value )
|
||||
int depth;
|
||||
char *errstr = "expected int argument of 8, 24, or 32";
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
|
||||
depth = PyInt_AsLong( value );
|
||||
@@ -2227,7 +2227,7 @@ static int RenderData_setRenderWinSize( BPy_RenderData *self, PyObject *value )
|
||||
int size;
|
||||
char *errstr = "expected int argument of 25, 50, 75, or 100";
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
|
||||
|
||||
size = PyInt_AsLong( value );
|
||||
@@ -2319,7 +2319,7 @@ static int RenderData_setThreads( BPy_RenderData *self, PyObject *value )
|
||||
{
|
||||
int threads;
|
||||
|
||||
if( !PyInt_CheckExact( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, "Error, threads must be an int" );
|
||||
|
||||
threads = PyInt_AsLong( value );
|
||||
|
||||
@@ -623,7 +623,7 @@ static int setIntAttrClamp( BPy_Sequence *self, PyObject *value, void *type )
|
||||
struct Sequence *seq= self->seq;
|
||||
int number, origval=0;
|
||||
|
||||
if( !PyInt_CheckExact ( value ) )
|
||||
if( !PyInt_Check( value ) )
|
||||
return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" );
|
||||
|
||||
number = PyInt_AS_LONG( value );
|
||||
|
||||
Reference in New Issue
Block a user