瀏覽代碼

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 年之前
父節點
當前提交
9f1c5b4640
共有 1 個文件被更改,包括 1 次插入3 次删除
  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);