mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
commit
535b3304cc
9 changed files with 355 additions and 6 deletions
|
@ -555,10 +555,15 @@ void yosys_setup()
|
|||
#undef X
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
PyImport_AppendInittab((char*)"libyosys", INIT_MODULE);
|
||||
Py_Initialize();
|
||||
PyRun_SimpleString("import sys");
|
||||
signal(SIGINT, SIG_DFL);
|
||||
// With Python 3.12, calling PyImport_AppendInittab on an already
|
||||
// initialized platform fails (such as when libyosys is imported
|
||||
// from a Python interpreter)
|
||||
if (!Py_IsInitialized()) {
|
||||
PyImport_AppendInittab((char*)"libyosys", INIT_MODULE);
|
||||
Py_Initialize();
|
||||
PyRun_SimpleString("import sys");
|
||||
signal(SIGINT, SIG_DFL);
|
||||
}
|
||||
#endif
|
||||
|
||||
Pass::init_register();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue