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

Commit87dd9fd

Browse files
committed
added a few debug checks
1 parent57525cd commit87dd9fd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

‎src/runtime/runtime.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,13 +1128,31 @@ internal static int PyObject_Compare(IntPtr value1, IntPtr value2)
11281128
internalstaticnintPyObject_Hash(IntPtrop)=>Delegates.PyObject_Hash(op);
11291129

11301130

1131-
internalstaticIntPtrPyObject_Repr(IntPtrpointer)=>Delegates.PyObject_Repr(pointer);
1131+
internalstaticIntPtrPyObject_Repr(IntPtrpointer)
1132+
{
1133+
AssertNoErorSet();
11321134

1135+
returnDelegates.PyObject_Repr(pointer);
1136+
}
11331137

11341138
internalstaticIntPtrPyObject_Str(IntPtrpointer)=>Delegates.PyObject_Str(pointer);
11351139

11361140

1137-
internalstaticIntPtrPyObject_Unicode(IntPtrpointer)=>Delegates.PyObject_Unicode(pointer);
1141+
internalstaticIntPtrPyObject_Unicode(IntPtrpointer)
1142+
{
1143+
AssertNoErorSet();
1144+
1145+
returnDelegates.PyObject_Unicode(pointer);
1146+
}
1147+
1148+
[Conditional("DEBUG")]
1149+
internalstaticvoidAssertNoErorSet()
1150+
{
1151+
if(Exceptions.ErrorOccurred())
1152+
thrownewInvalidOperationException(
1153+
"Can't call with exception set",
1154+
PythonException.FetchCurrent());
1155+
}
11381156

11391157

11401158
internalstaticIntPtrPyObject_Dir(IntPtrpointer)=>Delegates.PyObject_Dir(pointer);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp