From 7f7058d8ceea11663c8501cc9714d6e99de3925b Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Fri, 20 Jan 2017 16:26:28 +0700 Subject: [PATCH] #691, #812: fix unicode compat with py3 --- pythonx/UltiSnips/snippet_manager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index 92553ea..be44816 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -836,8 +836,13 @@ class SnippetManager(object): self._should_update_textobjects = True inserted_char = _vim.as_unicode(_vim.eval('v:char')) - if not isinstance(inserted_char, unicode): - return + + if sys.version_info >= (3, 0): + if isinstance(inserted_char, bytes): + return + else: + if not isinstance(inserted_char, unicode): + return try: if inserted_char == '':