[QUESTION] Determine if interpreter is running #3661
Unanswered
cliffburdick
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have an application that uses gtest+pybind11 to test some API calls in a library, but that library also needs to use pybind11 in some calls outside of the test framework. I used to have the scoped_interpreter created in the gtest main right before the tests start, and it would go out of scope when they finished. The problem is when using the library when not in test mode I need certain functions to start the interpreter. If I have them do it right now, I get an error that an interpreter is already running from the test suite when I run it. I also tried to make the scoped_interpreter a static class member for my pybind11 wrapper, and that almost works, except it segfaults when the application exits:
Is there a way to determine if the interpreter is already running so I don't start it again? I also tried catching the exception thrown, but that still prints the error that the interpreter is already running as well. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions