Skip to content

Commit 193fd7b

Browse files
author
Patric Schmitz
committed
additional debug output if python module loading fails
1 parent be50a7e commit 193fd7b

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
@@ -121,12 +121,15 @@ struct _interpreter {
121121
PyObject* cmname = PyString_FromString("matplotlib.cm");
122122
PyObject* pylabname = PyString_FromString("pylab");
123123
if (!pyplotname || !pylabname || !matplotlibname || !cmname) {
124-
throw std::runtime_error("couldnt create string");
124+
throw std::runtime_error("couldnt create string");
125125
}
126126

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

131134
// matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
132135
// 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