File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -125,20 +125,13 @@ public static int Size(IntPtr ob)
125
125
public static int ob_type ;
126
126
private static int ob_dict ;
127
127
private static int ob_data ;
128
- private static readonly Dictionary < IntPtr , bool > ExceptionTypeCache = new Dictionary < IntPtr , bool > ( ) ;
129
128
130
129
private static bool IsException ( IntPtr pyObject )
131
130
{
132
- bool res ;
133
131
var type = Runtime . PyObject_TYPE ( pyObject ) ;
134
- if ( ! ExceptionTypeCache . TryGetValue ( type , out res ) )
135
- {
136
- res = Runtime . PyObjectType_TypeCheck ( type , Exceptions . BaseException )
137
- || Runtime . PyObjectType_TypeCheck ( type , Runtime . PyTypeType )
138
- && Runtime . PyType_IsSubtype ( pyObject , Exceptions . BaseException ) ;
139
- ExceptionTypeCache . Add ( type , res ) ;
140
- }
141
- return res ;
132
+ return Runtime . PyObjectType_TypeCheck ( type , Exceptions . BaseException )
133
+ || Runtime . PyObjectType_TypeCheck ( type , Runtime . PyTypeType )
134
+ && Runtime . PyType_IsSubtype ( pyObject , Exceptions . BaseException ) ;
142
135
}
143
136
}
144
137
You can’t perform that action at this time.
0 commit comments