Parcourir la source

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 il y a 14 ans
Parent
commit
9f1c5b4640
1 fichiers modifiés avec 1 ajouts et 3 suppressions
  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);