Skip to content

Commit 4c320ca

Browse files
committed
make new connection spec whitespace insensitive
1 parent 0174020 commit 4c320ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ftplugin/python/ipy.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,31 @@ except NameError:
5151

5252
def km_from_string(s):
5353
"""create kernel manager from IPKernelApp string
54-
such as '--shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for 0.11
55-
or just 'kernel-12345.json' for 0.12
54+
such as '--shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for IPython 0.11
55+
or just 'kernel-12345.json' for IPython 0.12
5656
"""
5757
from os.path import join as pjoin
5858
from IPython.zmq.blockingkernelmanager import BlockingKernelManager, Empty
5959
from IPython.config.loader import KeyValueConfigLoader
6060
from IPython.zmq.kernelapp import kernel_aliases
6161
global km,send,Empty
6262

63+
s = s.replace('--existing', '')
6364
if 'connection_file' in BlockingKernelManager.class_trait_names():
6465
from IPython.lib.kernel import find_connection_file
6566
# 0.12 uses files instead of a collection of ports
6667
# include default IPython search path
6768
# filefind also allows for absolute paths, in which case the search
6869
# is ignored
6970
try:
70-
fullpath = find_connection_file(s)
71+
fullpath = find_connection_file(s.lstrip().rstrip())
7172
except IOError,e:
7273
echo(":IPython " + s + " failed", "Info")
7374
echo("^-- failed --" + s + " not found", "Error")
7475
return
7576
km = BlockingKernelManager(connection_file = fullpath)
7677
km.load_connection_file()
7778
else:
78-
s = s.replace('--existing', '')
7979
loader = KeyValueConfigLoader(s.split(), aliases=kernel_aliases)
8080
cfg = loader.load_config()['KernelApp']
8181
try:

0 commit comments

Comments
 (0)