From 4724e18b633e54dbaac39759770601cc1979893a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 15 Jan 2014 12:17:51 +0100 Subject: [PATCH] new version stuff --- jedi_vim.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jedi_vim.py b/jedi_vim.py index ef2ce97..1fd7afd 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -10,7 +10,7 @@ from shlex import split as shsplit import vim import jedi -from jedi._compatibility import unicode, is_py3k +from jedi._compatibility import unicode, is_py3 def catch_and_print_exceptions(func): @@ -62,7 +62,7 @@ class PythonToVimStr(unicode): __slots__ = [] def __new__(cls, obj, encoding='UTF-8'): - if is_py3k or isinstance(obj, unicode): + if is_py3 or isinstance(obj, unicode): return unicode.__new__(cls, obj) else: return unicode.__new__(cls, obj, encoding) @@ -466,5 +466,11 @@ def escape_file_path(path): def print_to_stdout(level, str_out): print(str_out) -if not hasattr(jedi, '__version__') or jedi.__version__ < (0, 7, 0): + +version = jedi.__version__ +if isinstance(version, str): + # the normal use case, now. + from jedi import utils + version = utils.version_info() +if version < (0, 7): echo_highlight('Please update your Jedi version, it is to old.')