From 2b841ff6f25195453a5e25ccc4d91998f4ebeb18 Mon Sep 17 00:00:00 2001 From: nve3pd Date: Thu, 28 Sep 2017 21:30:32 +0900 Subject: [PATCH] corresponded to python3 --- autoload/nim.vim | 6 +++++- autoload/nim_vim.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/autoload/nim.vim b/autoload/nim.vim index c24b12e..cc2e4cd 100644 --- a/autoload/nim.vim +++ b/autoload/nim.vim @@ -9,7 +9,11 @@ if !executable('nim') echoerr "the Nim compiler must be in your system's PATH" endif -exe 'pyfile ' . fnameescape(s:plugin_path) . '/nim_vim.py' +if has("python3") + exe 'py3file ' . fnameescape(s:plugin_path) . '/nim_vim.py' +else + exe 'pyfile ' . fnameescape(s:plugin_path) . '/nim_vim.py' +endif fun! nim#init() let cmd = printf("nim --dump.format:json --verbosity:0 dump %s", s:CurrentNimFile()) diff --git a/autoload/nim_vim.py b/autoload/nim_vim.py index c72dc41..dde6e9f 100644 --- a/autoload/nim_vim.py +++ b/autoload/nim_vim.py @@ -1,4 +1,10 @@ -import threading, Queue, subprocess, signal, os, platform, getpass +from sys import version_info +import threading, subprocess, signal, os, platform, getpass + +if version_info[0] == 3: + import queue as Queue +else: + import Queue try: import vim