This repository was archived by the owner on Jun 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ inline pybind11::module pyobject_from_gobj(gpointer ptr){
1414}
1515
1616Python::Interpreter::Interpreter (){
17+ #ifdef _WIN32
18+ auto root_path=Config::get ().terminal .msys2_mingw_path ;
19+ append_path (root_path/" include/python3.5m" );
20+ append_path (root_path/" lib/python3.5" );
21+ long long unsigned size = 0L ;
22+ #else
23+ long unsigned size = 0L ;
24+ #endif
1725 auto init_juci_api=[](){
1826 pybind11::module (pygobject_init (-1 ,-1 ,-1 ),false );
1927 pybind11::module api (" jucpp" ," Python bindings for juCi++" );
@@ -52,6 +60,8 @@ Python::Interpreter::Interpreter(){
5260 add_path (Config::get ().python .site_packages );
5361 add_path (plugin_path);
5462 Py_Initialize ();
63+ argv=Py_DecodeLocale (" " ,&size);
64+ PySys_SetArgv (0 ,&argv);
5565 boost::filesystem::directory_iterator end_it;
5666 for (boost::filesystem::directory_iterator it (plugin_path);it!=end_it;it++){
5767 auto module_name=it->path ().stem ().string ();
@@ -72,6 +82,8 @@ pybind11::module Python::Interpreter::import(const std::string &module_name){
7282}
7383
7484void Python::Interpreter::add_path (const boost::filesystem::path &path){
85+ if (path.empty ())
86+ return ;
7587 std::wstring sys_path (Py_GetPath ());
7688 if (!sys_path.empty ())
7789#ifdef _WIN32
You can’t perform that action at this time.
0 commit comments