File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 26
26
* .exe
27
27
* .out
28
28
* .app
29
+
30
+ # Logfiles
31
+ * .tlog
32
+ * .log
Original file line number Diff line number Diff line change 10
10
#include < functional>
11
11
#endif
12
12
13
+ #ifdef PY_INCLUDE
14
+ #include < Python.h>
15
+ #else
13
16
#include < python2.7/Python.h>
17
+ #endif
18
+
19
+ #if PY_MAJOR_VERSION >= 3
20
+ #define PyString_FromString PyUnicode_FromString
21
+ #endif
22
+
14
23
15
24
namespace matplotlibcpp {
16
25
@@ -48,8 +57,14 @@ namespace matplotlibcpp {
48
57
49
58
private:
50
59
_interpreter () {
51
- char name[] = " plotting" ; // silence compiler warning about const strings
52
- Py_SetProgramName (name); // optional but recommended
60
+
61
+ // optional but recommended
62
+ #if PY_MAJOR_VERSION >= 3
63
+ wchar_t name[] = L" plotting" ;
64
+ #else
65
+ char name[] = " plotting" ;
66
+ #endif
67
+ Py_SetProgramName (name);
53
68
Py_Initialize ();
54
69
55
70
PyObject* pyplotname = PyString_FromString (" matplotlib.pyplot" );
@@ -62,7 +77,7 @@ namespace matplotlibcpp {
62
77
63
78
PyObject* pylabmod = PyImport_Import (pylabname);
64
79
Py_DECREF (pylabname);
65
- if (!pymod ) { throw std::runtime_error (" Error loading module pylab!" ); }
80
+ if (!pylabmod ) { throw std::runtime_error (" Error loading module pylab!" ); }
66
81
67
82
s_python_function_show = PyObject_GetAttrString (pymod, " show" );
68
83
s_python_function_figure = PyObject_GetAttrString (pymod, " figure" );
You can’t perform that action at this time.
0 commit comments