diff --git a/src/core/IronPython/Runtime/ClrModule.cs b/src/core/IronPython/Runtime/ClrModule.cs index 4d05e1442..e9382f31f 100644 --- a/src/core/IronPython/Runtime/ClrModule.cs +++ b/src/core/IronPython/Runtime/ClrModule.cs @@ -1179,9 +1179,7 @@ public static void EnableProfiler(CodeContext/*!*/ context, bool enable) { // something more complex, let the binary formatter handle it BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); -#pragma warning disable SYSLIB0011 // BinaryFormatter serialization methods are obsolete in .NET 5.0 bf.Serialize(stream, self); -#pragma warning restore SYSLIB0011 data = stream.ToArray().MakeString(); format = null; } @@ -1225,9 +1223,7 @@ public static object Deserialize(string serializationFormat, [NotNone] string/*! MemoryStream stream = new MemoryStream(data.MakeByteArray()); BinaryFormatter bf = new BinaryFormatter(); -#pragma warning disable SYSLIB0011 // BinaryFormatter serialization methods are obsolete in .NET 5.0 return bf.Deserialize(stream); -#pragma warning restore SYSLIB0011 } #endif }