Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 465cd23

Browse files
committed
fix for old object_info, closes #69 and #65
for IPython < 0.13, object_info took only one argument, instead of two
1 parent ff8f88f commit 465cd23

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ftplugin/python/ipy.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ def km_from_string(s=''):
163163
kc = km
164164
kc.start_channels()
165165
send = kc.shell_channel.execute
166+
167+
#XXX: backwards compatability for IPython < 0.13
168+
import inspect
169+
sc = kc.shell_channel
170+
num_oinfo_args = len(inspect.getargspec(sc.object_info).args)
171+
if num_oinfo_args == 2:
172+
# patch the object_info method which used to only take one argument
173+
klass = sc.__class__
174+
klass._oinfo_orig = klass.object_info
175+
klass.object_info = lambda s,x,y: s._oinfo_orig(x)
166176

167177
#XXX: backwards compatability for IPython < 1.0
168178
if not hasattr(kc, 'iopub_channel'):

0 commit comments

Comments
 (0)