From 08c23401e5d9b37ac2ffceb1b5a783e1bc95ef5a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 3 Sep 2018 18:16:10 +0300 Subject: [PATCH] .vim/python/completion.py: Fix "bare exec" in Python 2 Prevent SyntaxError: unqualified exec is not allowed in function 'vim_calc' it contains a nested function with free variables. The problem is that ''.join('\\x%02x' % ord(x) for x in str(_)) creates a generator. --- .vim/python/completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vim/python/completion.py b/.vim/python/completion.py index 037a93d..036aef8 100644 --- a/.vim/python/completion.py +++ b/.vim/python/completion.py @@ -32,7 +32,7 @@ def vim_calc(command): if result != None: print(result) _ = result - xx = ''.join('\\x%02x' % ord(x) for x in str(_)) + xx = ''.join(['\\x%02x' % ord(x) for x in str(_)]) vim.command('let @" = "%s"' % xx) def vim_pydo(command): -- 2.39.2