Skip to content

Commit

Permalink
Use python 3 engine
Browse files Browse the repository at this point in the history
  • Loading branch information
intelfx committed Jun 1, 2016
1 parent cb046f5 commit 0085142
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin/snake.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python << EOF
python3 << EOF
import sys
import vim
sys.path.insert(0, vim.eval("expand('<sfile>:p:h')"))
Expand Down
10 changes: 5 additions & 5 deletions plugin/snake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def abbrev(word, expansion, local=False):

if callable(expansion):
fn_str = register_fn(expansion)
expansion = "<C-r>=pyeval('%s')<CR>" % escape_string_sq(fn_str)
expansion = "<C-r>=py3eval('%s')<CR>" % escape_string_sq(fn_str)

command("%s %s %s" % (cmd, word, expansion))

Expand Down Expand Up @@ -239,7 +239,7 @@ def multi_let(namespace, **name_values):
let(name, value, namespace=namespace)

def _serialize_obj(obj):
if isinstance(obj, basestring):
if isinstance(obj, str):
obj = "'%s'" % escape_string_sq(obj)
# TODO allow other kinds of serializations?
return obj
Expand Down Expand Up @@ -405,7 +405,7 @@ def wrapped():
fn = wrapped

call = register_fn(fn)
command("%s <silent> %s :python %s<CR>" % (map_command, key, call))
command("%s <silent> %s :python3 %s<CR>" % (map_command, key, call))

else:
command("%s %s %s" % (map_command, key, maybe_fn))
Expand Down Expand Up @@ -647,7 +647,7 @@ def wrapped(fn):
command("autocmd!")
ctx = AutoCommandContext()
call = register_fn(partial(fn, ctx))
command("autocmd %s %s :python %s" % (event, filetype, call))
command("autocmd %s %s :python3 %s" % (event, filetype, call))
command("augroup END")
return fn

Expand All @@ -661,4 +661,4 @@ def wrapped(fn):
if "snake.plugin_loader" in sys.modules:
plugin_loader = reload(plugin_loader)
else:
import plugin_loader
from . import plugin_loader

0 comments on commit 0085142

Please sign in to comment.