File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change @@ -131,34 +131,13 @@ public static int nb_bool(BorrowedReference ob)
131
131
}
132
132
}
133
133
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
-
156
134
public new static NewReference tp_repr ( BorrowedReference ob )
157
135
{
158
136
if ( GetManagedObject ( ob ) is not CLRObject co )
159
137
{
160
- return Exceptions . RaiseTypeError ( "invalid object" ) ;
138
+ return Exceptions . RaiseTypeError ( "invalid enum object" ) ;
161
139
}
140
+
162
141
if ( co . inst . GetType ( ) . IsEnum )
163
142
{
164
143
return Runtime . PyString_FromString ( GetEnumReprString ( ( Enum ) co . inst ) ) ;
You can’t perform that action at this time.
0 commit comments