Skip to content

Commit 05087cf

Browse files
Patric SchmitzBenno Evers
authored andcommitted
Additional debug output if python module loading fails
1 parent d42a969 commit 05087cf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

matplotlibcpp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ struct _interpreter {
122122
PyObject* cmname = PyString_FromString("matplotlib.cm");
123123
PyObject* pylabname = PyString_FromString("pylab");
124124
if (!pyplotname || !pylabname || !matplotlibname || !cmname) {
125-
throw std::runtime_error("couldnt create string");
125+
throw std::runtime_error("couldnt create string");
126126
}
127127

128128
PyObject* matplotlib = PyImport_Import(matplotlibname);
129129
Py_DECREF(matplotlibname);
130-
if (!matplotlib) { throw std::runtime_error("Error loading module matplotlib!"); }
130+
if (!matplotlib) {
131+
PyErr_Print();
132+
throw std::runtime_error("Error loading module matplotlib!");
133+
}
131134

132135
// matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
133136
// or matplotlib.backends is imported for the first time

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy