Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4f18f9e

Browse files
committed
RaiseIndexMustBeIntegerError
1 parentfbd5846 commit4f18f9e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/runtime/arrayobject.cs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
161161
{
162162
if(!Runtime.PyInt_Check(idx))
163163
{
164-
returnRaiseTypeError(idx);
164+
returnRaiseIndexMustBeIntegerError(idx);
165165
}
166166
index=Runtime.PyInt_AsLong(idx);
167167

@@ -205,7 +205,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
205205
IntPtrop=Runtime.PyTuple_GetItem(idx,i);
206206
if(!Runtime.PyInt_Check(op))
207207
{
208-
returnRaiseTypeError(op);
208+
returnRaiseIndexMustBeIntegerError(op);
209209
}
210210
index=Runtime.PyInt_AsLong(op);
211211

@@ -263,7 +263,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
263263
{
264264
if(!Runtime.PyInt_Check(idx))
265265
{
266-
RaiseTypeError(idx);
266+
RaiseIndexMustBeIntegerError(idx);
267267
return-1;
268268
}
269269
index=Runtime.PyInt_AsLong(idx);
@@ -306,7 +306,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
306306
IntPtrop=Runtime.PyTuple_GetItem(idx,i);
307307
if(!Runtime.PyInt_Check(op))
308308
{
309-
RaiseTypeError(op);
309+
RaiseIndexMustBeIntegerError(op);
310310
return-1;
311311
}
312312
index=Runtime.PyInt_AsLong(op);
@@ -338,7 +338,7 @@ static NewReference NewInstance(Type elementType, BorrowedReference arrayPyType,
338338
return0;
339339
}
340340

341-
privatestaticIntPtrRaiseTypeError(IntPtridx)
341+
privatestaticIntPtrRaiseIndexMustBeIntegerError(IntPtridx)
342342
{
343343
stringtpName=Runtime.PyObject_GetTypeName(idx);
344344
returnExceptions.RaiseTypeError($"array index has type{tpName}, expected an integer");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp