diff --git a/src/embed_tests/pytuple.cs b/src/embed_tests/pytuple.cs index 88910147c..03c450694 100644 --- a/src/embed_tests/pytuple.cs +++ b/src/embed_tests/pytuple.cs @@ -6,29 +6,6 @@ namespace Python.EmbeddingTest { public class PyTupleTest { - /// - /// Tests set-up. Being used to skip class on Travis/PY27 - /// - /// - /// FIXME: Fails on Travis/PY27: All tests below (unless otherwise stated) - /// Fatal Python error: auto-releasing thread-state, but no thread-state for this thread - /// Stacktrace: - /// at (wrapper managed-to-native) Python.Runtime.Runtime.PyGILState_Release (intptr) - /// at Python.Runtime.PythonEngine.ReleaseLock (intptr) - /// at Python.Runtime.PythonException.Dispose () - /// at Python.Runtime.PythonException.Finalize () - /// at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) - /// - [SetUp] - public void SetUp() - { - if (Environment.GetEnvironmentVariable("TRAVIS") == "true" && - Environment.GetEnvironmentVariable("TRAVIS_PYTHON_VERSION") == "2.7") - { - Assert.Ignore("Fails on Travis/PY27: Fatal Python error: auto-releasing thread-state, but no thread-state for this thread"); - } - } - /// /// Test IsTupleType without having to Initialize a tuple. /// PyTuple constructor use IsTupleType. This decouples the tests. diff --git a/src/runtime/pythonexception.cs b/src/runtime/pythonexception.cs index 8e2f992f4..58b33f0f3 100644 --- a/src/runtime/pythonexception.cs +++ b/src/runtime/pythonexception.cs @@ -140,7 +140,7 @@ public void Dispose() { if (!disposed) { - if (Runtime.Py_IsInitialized() > 0) + if (Runtime.Py_IsInitialized() > 0 && !Runtime.IsFinalizing) { IntPtr gs = PythonEngine.AcquireLock(); Runtime.XDecref(_pyType);