Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Use PyConfig to configure python interpreter #1118

Merged
merged 4 commits into from
Jan 12, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into init-config
  • Loading branch information
Hood committed Jan 11, 2021
commit a6218609a7853919435f49fd4840fabe0ad61362
21 changes: 20 additions & 1 deletion src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ initialize_python()
Py_ExitStatusException(status);
}
}
#define TRY_INIT_WITH_CORE_MODULE(mod) \
do { \
if (mod##_init(core_module)) { \
FATAL_ERROR("Failed to initialize module %s.\n", #mod); \
} \
} while (0)

static struct PyModuleDef core_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "_pyodide_core",
.m_doc = "Pyodide C builtins",
.m_size = -1,
};

int
main(int argc, char** argv)
Expand All @@ -73,8 +86,14 @@ main(int argc, char** argv)
if (sizeof(JsRef) != sizeof(int)) {
FATAL_ERROR("JsRef doesn't have the same size as int.");
}
TRY_INIT(hiwire);

PyObject* core_module = NULL;
core_module = PyModule_Create(&core_module_def);
if (core_module == NULL) {
FATAL_ERROR("Failed to create core module.");
}

TRY_INIT(hiwire);
TRY_INIT(error_handling);
TRY_INIT(js2python);
TRY_INIT(JsImport);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.