Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Fix for Issue #70: stopPython() errors - #71

Merged
forman merged 8 commits into
bcdev:masterfrom
voutilad:master
Sep 1, 2016
Merged

forman merged 8 commits into
bcdev:masterfrom
voutilad:master

Conversation

@voutilad

Copy link
Copy Markdown
Contributor

I believe I've fixed the issues starting and stopping the Python interpreter from Java. It involves three parts:

  • making sure to call PyGILState_Ensure() before Py_Finalize()
  • reseting the JPy_InitThreads flag to 0
  • resetting the JPY bridge state by calling JPy_free()

I've added a test that starts and stops the interpreter twice using calls to PyLib.startPython()/PyLib.stopPython().

I also tweaked the tests to use the JUnit @Before/@After annotations so each test in the test classes gets a brand new interpreter state.

I've been able to test on macOS using CPython 2.7 and 3.5 and both have all tests passing.

…est. seems tests will each run individually, but if run sequentially by the same testrunner they start to exhibit strange failures.
…Handler fixes debugger issues invoking calls to non-existant toString python method. setting a timeout on the multithreaded test lets other tests execute post deadlock
@forman
forman merged commit 1cd3316 into bcdev:master Sep 1, 2016
@forman

forman commented Sep 1, 2016

Copy link
Copy Markdown
Member

Thanks! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants