From: Oleg Broytman Date: Mon, 3 Sep 2018 15:16:10 +0000 (+0300) Subject: .vim/python/completion.py: Fix "bare exec" in Python 2 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=08c23401e5d9b37ac2ffceb1b5a783e1bc95ef5a;p=dotfiles.git .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. --- 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):