Bladeren bron

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 14 jaren geleden
bovenliggende
commit
9f1c5b4640
1 gewijzigde bestanden met toevoegingen van 1 en 3 verwijderingen
  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);