Quellcode durchsuchen

ctkPythonConsole - Import the interactive help module

Since the standard input are now properly handled, the interactive
help module is imported from pydoc instead of setting
the 'help' variable to be 'pydoc.help.help'
Jean-Christophe Fillion-Robin vor 14 Jahren
Ursprung
Commit
9f1c5b4640
1 geänderte Dateien mit 1 neuen und 3 gelöschten Zeilen
  1. 1 3
      Libs/Scripting/Python/Widgets/ctkPythonConsole.cpp

+ 1 - 3
Libs/Scripting/Python/Widgets/ctkPythonConsole.cpp

@@ -361,9 +361,7 @@ void ctkPythonConsole::initialize(ctkAbstractPythonManager* newPythonManager)
 
   // Expose help() function
   QStringList helpImportCode;
-  helpImportCode << "import pydoc";
-  helpImportCode << "help = pydoc.help.help";
-  helpImportCode << "del pydoc";
+  helpImportCode << "from pydoc import help";
   d->PythonManager->executeString(helpImportCode.join("\n"));
 
   this->setDisabled(false);