/// Replaces Value with an instance of Type, if Value is not already an instance of Type.
/// </summary>
publicvoidNormalize()
{
CheckRuntimeIsRunning();
PyGILStategs=PythonEngine.AcquireLock();
try
{
if(Exceptions.ErrorOccurred())thrownewInvalidOperationException("Cannot normalize when an error is set");
// If an error is set and this PythonException is unnormalized, the error will be cleared and the PythonException will be replaced by a different error.