From 635d2f2a90d4d8c1d8e1b125bac9f222267c8c55 Mon Sep 17 00:00:00 2001 From: Fredrik Hansson Date: Wed, 7 Sep 2016 10:49:52 +0200 Subject: [PATCH] fixed invalid syntax with python 2.6.6 --- plugin/autoformat.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index 1595d78..2bccbb7 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -186,7 +186,11 @@ if int(vim.eval('exists("g:formatterpath")')): # When an entry is unicode, Popen can't deal with it in Python 2. # As a pragmatic fix, we'll omit that entry. -env = {key : val for key, val in env.iteritems() if type(key) == type(val) == str} +newenv = {} +for key,val in env.iteritems(): + if type(key) == type(val) == str: + newenv[key] = val +env=newenv p = subprocess.Popen(formatprg, env=env, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) stdoutdata, stderrdata = p.communicate(text)