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

Commit7d6e27a

Browse files
committed
Allow conversion of UInt64 based enums
1 parent4f070f2 commit7d6e27a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/runtime/Codecs/EnumPyIntCodec.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ public bool TryDecode<T>(PyObject pyObj, out T? value)
5353
varenumType=value.GetType();
5454
if(!enumType.IsEnum)returnnull;
5555

56-
returnnewPyInt(Convert.ToInt64(value));
56+
try
57+
{
58+
returnnewPyInt(Convert.ToInt64(value));
59+
}
60+
catch(OverflowException)
61+
{
62+
returnnewPyInt(Convert.ToUInt64(value));
63+
}
5764
}
5865

5966
privateEnumPyIntCodec(){}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp