Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First steps with Python.NET
#12
Catch the exception.

Code:
Copy      Help
    public void Dispose() {
        _m?.Dispose();
        _gil?.Dispose();
        if (_shutdown) {
            try { PythonEngine.Shutdown(); } //without this the process does not exit
            catch (System.Runtime.Serialization.SerializationException) { } //thrown when using enablePrint
            catch (PlatformNotSupportedException) { } //.NET 9+: BinaryFormatter serialization and deserialization have been removed
        }
    }

https://github.com/pythonnet/pythonnet/issues/2469


Messages In This Thread
First steps with Python.NET - by burque505 - 06-17-2023, 09:16 PM
RE: First steps with Python.NET - by burque505 - 06-17-2023, 10:23 PM
RE: First steps with Python.NET - by Gintaras - 06-18-2023, 05:58 AM
RE: First steps with Python.NET - by burque505 - 06-18-2023, 12:27 PM
RE: First steps with Python.NET - by Gintaras - 08-01-2023, 06:38 PM
RE: First steps with Python.NET - by Gintaras - 08-01-2023, 06:40 PM
RE: First steps with Python.NET - by burque505 - 08-01-2023, 07:42 PM
RE: First steps with Python.NET - by Davider - 01-29-2024, 01:10 AM
RE: First steps with Python.NET - by Gintaras - 01-29-2024, 09:15 AM
RE: First steps with Python.NET - by Davider - 01-29-2024, 01:49 PM
RE: First steps with Python.NET - by burque505 - 05-16-2025, 09:41 PM
RE: First steps with Python.NET - by Gintaras - 05-19-2025, 04:27 PM
RE: First steps with Python.NET - by Davider - 06-09-2025, 08:39 AM
RE: First steps with Python.NET - by Gintaras - 06-09-2025, 09:48 AM
RE: First steps with Python.NET - by Davider - 06-09-2025, 09:56 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)