2015-06-16 34 views
6

我嘗試修復項目中的所有pylint錯誤和pylint警告。但是當我設置一個元類時,我不斷收到錯誤(https://www.python.org/dev/peps/pep-3115/)。使用元類時Pylint錯誤

這裏是我的示例代碼:

錯誤只是說 「無效語法」。我通過合成vim插件使用pylint(https://github.com/scrooloose/syntastic)。

我pylint的版本(pylint的--version):

pylint 1.4.3, 
astroid 1.3.6, common 0.63.2 
Python 3.4.2 (default, Oct 8 2014, 10:45:20) 
[GCC 4.9.1] 

我syntastic插件是最新的與GitHub上。

有什麼想法?

+2

你使用python2的pylint?文檔建議'let g:syntastic_python_python_exec ='/ path/to/python3'' –

+1

非常感謝,修復了它! – linluk

+1

@PadraicCunningham:請將您的評論轉換爲答案,以便我們投票支持! :) –

回答

3

docs4.2。問:蟒蛇檢查抱怨語法有效的Python 3層結構...

A.配置蟒蛇檢查調用一個Python解釋器3而不是Python 2中,如:

let g:syntastic_python_python_exec = '/path/to/python3' 
+1

謝謝,現在我能在它發生的時候找到它。 ;) –

+0

再次感謝!我接受了它。 – linluk