Skip to content

Commit 4feb745

Browse files
committed
enum object cleanups
1 parent a997f7f commit 4feb745

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

src/runtime/Types/EnumObject.cs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,34 +131,13 @@ public static int nb_bool(BorrowedReference ob)
131131
}
132132
}
133133

134-
//public static NewReference tp_str(BorrowedReference ob)
135-
//{
136-
// var co = GetManagedObject(ob) as CLRObject;
137-
// if (co == null)
138-
// {
139-
// return Exceptions.RaiseTypeError("invalid enum object");
140-
// }
141-
// try
142-
// {
143-
// return Runtime.PyString_FromString(co.inst.ToString());
144-
// }
145-
// catch (Exception e)
146-
// {
147-
// if (e.InnerException != null)
148-
// {
149-
// e = e.InnerException;
150-
// }
151-
// Exceptions.SetError(e);
152-
// return default;
153-
// }
154-
//}
155-
156134
public new static NewReference tp_repr(BorrowedReference ob)
157135
{
158136
if (GetManagedObject(ob) is not CLRObject co)
159137
{
160-
return Exceptions.RaiseTypeError("invalid object");
138+
return Exceptions.RaiseTypeError("invalid enum object");
161139
}
140+
162141
if (co.inst.GetType().IsEnum)
163142
{
164143
return Runtime.PyString_FromString(GetEnumReprString((Enum)co.inst));

0 commit comments

Comments
 (0)