From 16ce76c44e68b0559e6269a7b11defbb251e577c 2010-02-01 07:18:03 From: Brian Granger Date: 2010-02-01 07:18:03 Subject: [PATCH] Fixing two small bugs in :mod:`IPython.kernel`. * In :mod:`IPython.kernel.launcher` we were not handling the lookup of ``job.exe`` properly on Windows if the HPC pack was not installed. * When :mod:`IPython.kernel.client` was imported, Twisted was giving warnings that we have silenced. --- diff --git a/IPython/kernel/client.py b/IPython/kernel/client.py index acb3cfa..13de59b 100644 --- a/IPython/kernel/client.py +++ b/IPython/kernel/client.py @@ -24,15 +24,25 @@ The main classes in this module are: #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- -# Imports +# Warnings control #----------------------------------------------------------------------------- -import sys import warnings -# from IPython.utils import growl -# growl.start("IPython1 Client") +# Twisted generates annoying warnings with Python 2.6, as will do other code +# that imports 'sets' as of today +warnings.filterwarnings('ignore', 'the sets module is deprecated', + DeprecationWarning ) + +# This one also comes from Twisted +warnings.filterwarnings('ignore', 'the sha module is deprecated', + DeprecationWarning) + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +import sys from twisted.internet import reactor from twisted.internet.error import PotentialZombieWarning @@ -73,8 +83,6 @@ rit.setDaemon(True) rit.start() - - __all__ = [ 'MapTask', 'StringTask', diff --git a/IPython/kernel/launcher.py b/IPython/kernel/launcher.py index cfbb82d..43cf057 100644 --- a/IPython/kernel/launcher.py +++ b/IPython/kernel/launcher.py @@ -23,7 +23,7 @@ from IPython.core.component import Component from IPython.external import Itpl from IPython.utils.traitlets import Str, Int, List, Unicode from IPython.utils.path import get_ipython_module_path -from IPython.utils.process import find_cmd, pycmd2argv +from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError from IPython.kernel.twistedutil import ( gatherBoth, make_deferred, @@ -538,7 +538,10 @@ class SSHEngineSetLauncher(BaseLauncher): # This is only used on Windows. def find_job_cmd(): if os.name=='nt': - return find_cmd('job') + try: + return find_cmd('job') + except FindCmdError: + return 'job' else: return 'job'