Skip to content

Commit 006cb3b

Browse files
committed
Minor fix for fatal error when converting C# enums to in
1 parent 223d1be commit 006cb3b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/Util/OpsHelper.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ internal static class EnumOps<T> where T : Enum
8383

8484
[ForbidPythonThreads]
8585
#pragma warning disable IDE1006 // Naming Styles - must match Python
86-
public static PyInt __int__(T value)
86+
public static object __int__(T value)
8787
#pragma warning restore IDE1006 // Naming Styles
88-
=> IsUnsigned
89-
? new PyInt(Convert.ToUInt64(value))
90-
: new PyInt(Convert.ToInt64(value));
88+
=> IsUnsigned ? Convert.ToUInt64(value) : Convert.ToInt64(value);
9189

9290
#region Arithmetic operators
9391

0 commit comments

Comments
 (0)