From 88d0204016934e83e374db534d2b6156aa4ac6bb Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 20 Sep 2017 14:59:54 +0200 Subject: [PATCH] Use maktaba#python#Eval for Python 3 support --- autoload/coverage/python.vim | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/autoload/coverage/python.vim b/autoload/coverage/python.vim index c02c81d..f87c2d4 100644 --- a/autoload/coverage/python.vim +++ b/autoload/coverage/python.vim @@ -25,16 +25,6 @@ function! s:GetCoverageFile() abort return fnamemodify(findfile('.coverage', ';'), ':p') endfunction -" Polyfill for vim's pyeval(). -" TODO(google/vim-maktaba#70): Use maktaba's implementation when available. -function! s:PyEval(expr) abort - if exists('*pyeval') - return pyeval(a:expr) - endif - python import json, vim - python vim.command('return ' + json.dumps(eval(vim.eval('a:expr')))) -endfunction - function! coverage#python#GetCoveragePyProvider() abort let l:provider = { \ 'name': 'coverage.py'} @@ -59,7 +49,7 @@ function! coverage#python#GetCoveragePyProvider() abort \ 'Generate one by running nosetests --with-coverage') endif call maktaba#python#ImportModule(s:plugin, 'vim_coverage') - let l:coverage_data = s:PyEval(printf( + let l:coverage_data = maktaba#python#Eval(printf( \ 'vim_coverage.GetCoveragePyLines(%s, %s)', \ string(l:cov_file), \ string(a:filename)))