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)
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 ) ) ;
You can’t perform that action at this time.
0 commit comments