diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp index f3524900b9..3de634ce05 100644 --- a/src/Base/Interpreter.cpp +++ b/src/Base/Interpreter.cpp @@ -468,7 +468,7 @@ void InterpreterSingleton::runFile(const char*pxFileName, bool local) } } -bool InterpreterSingleton::loadModule(const char* psModName, bool nofail) +bool InterpreterSingleton::loadModule(const char* psModName) { // buffer acrobatics //PyBuf ModName(psModName); @@ -478,14 +478,10 @@ bool InterpreterSingleton::loadModule(const char* psModName, bool nofail) module = PP_Load_Module(psModName); if (!module) { - if (nofail) - return false; - else { - if (PyErr_ExceptionMatches(PyExc_SystemExit)) - throw SystemExitException(); - else - throw PyException(); - } + if (PyErr_ExceptionMatches(PyExc_SystemExit)) + throw SystemExitException(); + else + throw PyException(); } return true; diff --git a/src/Base/Interpreter.h b/src/Base/Interpreter.h index 4fddafafa1..472b74602e 100644 --- a/src/Base/Interpreter.h +++ b/src/Base/Interpreter.h @@ -237,7 +237,7 @@ public: //@{ /* Loads a module */ - bool loadModule(const char* psModName, bool nofail=false); + bool loadModule(const char* psModName); /// Add an additional python path void addPythonPath(const char* Path); static void addType(PyTypeObject* Type,PyObject* Module, const char * Name); diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index d7368ec4ef..8a7563d437 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -692,18 +692,20 @@ void MainWindow::whatsThis() void MainWindow::showDocumentation(const QString& help) { - if (Base::Interpreter().loadModule("Help",true)) { + PyObject* module = PyImport_ImportModule("Help"); + if (module) { Gui::Command::addModule(Gui::Command::Gui,"Help"); Gui::Command::doCommand(Gui::Command::Gui,"Help.show(\"%s\")", help.toStdString().c_str()); - } else { + } + else { + PyErr_Clear(); QUrl url(help); if (url.scheme().isEmpty()) { //QString page; //page = QString::fromUtf8("%1.html").arg(help); //d->assistant->showDocumentation(page); QMessageBox::critical(getMainWindow(), tr("Help addon needed!"), - tr("The Help system of FreeCAD is now handled by the \"Help\" addon." - "Install it with menu Tools > Addons Manager")); + tr("The Help system of %s is now handled by the \"Help\" addon. Install it with menu Tools > Addons Manager"),qApp->applicationName()); } else { QDesktopServices::openUrl(url);