Browse Source

Fix issue lava/matplotlib-cpp#124

Barnabé BALP 4 years ago
parent
commit
f4b49a35d0
1 changed files with 5 additions and 0 deletions
  1. 5 0
      matplotlibcpp.h

+ 5 - 0
matplotlibcpp.h

@@ -153,6 +153,11 @@ private:
         Py_SetProgramName(name);
         Py_Initialize();
 
+        wchar_t const *dummy_args[] = {L"Python", NULL};  // const is needed because literals must not be modified
+        wchar_t const **argv = dummy_args;
+        int             argc = sizeof(dummy_args)/sizeof(dummy_args[0])-1;
+        PySys_SetArgv(argc, const_cast<wchar_t **>(argv));
+
 #ifndef WITHOUT_NUMPY
         import_numpy(); // initialize numpy C-API
 #endif