@@ -161,7 +161,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
161
161
{
162
162
if ( ! Runtime . PyInt_Check ( idx ) )
163
163
{
164
- return RaiseTypeError ( idx ) ;
164
+ return RaiseIndexMustBeIntegerError ( idx ) ;
165
165
}
166
166
index = Runtime . PyInt_AsLong ( idx ) ;
167
167
@@ -205,7 +205,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
205
205
IntPtr op = Runtime . PyTuple_GetItem ( idx , i ) ;
206
206
if ( ! Runtime . PyInt_Check ( op ) )
207
207
{
208
- return RaiseTypeError ( op ) ;
208
+ return RaiseIndexMustBeIntegerError ( op ) ;
209
209
}
210
210
index = Runtime . PyInt_AsLong ( op ) ;
211
211
@@ -263,7 +263,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
263
263
{
264
264
if ( ! Runtime . PyInt_Check ( idx ) )
265
265
{
266
- RaiseTypeError ( idx ) ;
266
+ RaiseIndexMustBeIntegerError ( idx ) ;
267
267
return - 1 ;
268
268
}
269
269
index = Runtime . PyInt_AsLong ( idx ) ;
@@ -306,7 +306,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
306
306
IntPtr op = Runtime . PyTuple_GetItem ( idx , i ) ;
307
307
if ( ! Runtime . PyInt_Check ( op ) )
308
308
{
309
- RaiseTypeError ( op ) ;
309
+ RaiseIndexMustBeIntegerError ( op ) ;
310
310
return - 1 ;
311
311
}
312
312
index = Runtime . PyInt_AsLong ( op ) ;
@@ -338,7 +338,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
338
338
return 0 ;
339
339
}
340
340
341
- private static IntPtr RaiseTypeError ( IntPtr idx )
341
+ private static IntPtr RaiseIndexMustBeIntegerError ( IntPtr idx )
342
342
{
343
343
string tpName = Runtime . PyObject_GetTypeName ( idx ) ;
344
344
return Exceptions . RaiseTypeError ( $ "array index has type { tpName } , expected an integer") ;
0 commit comments