Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix PythonException GC - no thread-state for this thread#400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vmuriart merged 1 commit intopythonnet:masterfromvmuriart:fix-py27-thread-state
Feb 23, 2017
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletionssrc/embed_tests/pytuple.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,29 +6,6 @@ namespace Python.EmbeddingTest
{
public class PyTupleTest
{
/// <summary>
/// Tests set-up. Being used to skip class on Travis/PY27
/// </summary>
/// <remarks>
/// 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)
/// </remarks>
[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");
}
}

/// <summary>
/// Test IsTupleType without having to Initialize a tuple.
/// PyTuple constructor use IsTupleType. This decouples the tests.
Expand Down
2 changes: 1 addition & 1 deletionsrc/runtime/pythonexception.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp