File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,13 @@ internal static void SaveRuntimeData(RuntimeDataStorage storage)
110
110
// No need to decref the member, the ClassBase instance does
111
111
// not own the reference.
112
112
Runtime . PyDict_DelItemString ( dict , member ) ;
113
+ if ( Exceptions . ExceptionMatches ( Exceptions . KeyError ) )
114
+ {
115
+ // Trying to remove a key that's not in the dictionary
116
+ // raises an error. We don't care about it.
117
+ Runtime . PyErr_Clear ( ) ;
118
+ }
113
119
}
114
- // Trying to remove a key that's not in the dictionary may
115
- // raise an error. We don't care about it.
116
- Runtime . PyErr_Clear ( ) ;
117
120
// We modified the Type object, notify it we did.
118
121
Runtime . PyType_Modified ( cls . Value . tpHandle ) ;
119
122
}
Original file line number Diff line number Diff line change @@ -346,10 +346,13 @@ protected override void OnSave(InterDomainContext context)
346
346
{
347
347
Runtime . PyDict_DelItemString ( dict , pair . Key ) ;
348
348
pair . Value . DecrRefCount ( ) ;
349
+ if ( Exceptions . ExceptionMatches ( Exceptions . KeyError ) )
350
+ {
351
+ // Trying to remove a key that's not in the dictionary
352
+ // raises an error. We don't care about it.
353
+ Runtime . PyErr_Clear ( ) ;
354
+ }
349
355
}
350
- // Trying to remove a key that's not in the dictionary may
351
- // raise an error. We don't care about it.
352
- Runtime . PyErr_Clear ( ) ;
353
356
354
357
cache . Clear ( ) ;
355
358
}
You can’t perform that action at this time.
0 commit comments