Improved Error reporting when Python passes are loaded
authorBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Wed, 3 Apr 2019 10:21:56 +0000 (12:21 +0200)
committerBenedikt Tutzer <e1225461@student.tuwien.ac.at>
Wed, 3 Apr 2019 10:21:56 +0000 (12:21 +0200)
passes/cmds/plugin.cc

index 2b06690f99af8b15878d1aa06f47be6417abdd92..bb1ec8716ef6c811da84c38a60bbc1b3c4c2153d 100644 (file)
@@ -61,12 +61,14 @@ void load_plugin(std::string filename, std::vector<std::string> aliases)
                        PyObject *filename_p = PyUnicode_FromString(filename.c_str());
                        if(filename_p == NULL)
                        {
+                               PyErr_Print();
                                log_cmd_error("Issues converting `%s' to Python\n", filename.c_str());
                                return;
                        }
                        PyObject *module_p = PyImport_Import(filename_p);
                        if(module_p == NULL)
                        {
+                               PyErr_Print();
                                log_cmd_error("Can't load python module `%s'\n", filename.c_str());
                                return;
                        }