diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-09-26 15:56:29 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-09-26 15:56:29 +0300 |
commit | bf91f20962206f73b4f0587887dcda4bc75efac0 (patch) | |
tree | 33c2bcc4f8dbd5ca06352324645bb88507453db1 | |
parent | 122028302eda53b9d7dca49616ff340ee88da8b7 (diff) | |
download | obnam-bf91f20962206f73b4f0587887dcda4bc75efac0.tar.gz |
Run pep8 conditionally depending on its version
-rwxr-xr-x | setup.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -249,7 +249,14 @@ class Check(Command): print "no .git, no nitpick for you" def check_with_pep8(self): - cliapp.runcmd(['pep8', 'obnamlib'], stdout=None, stderr=None) + output = cliapp.runcmd(['pep8', '--version']) + parts = output.strip().split('.') + # pep8 version 1.5.7 is in Debian jessie. Previous versions + # give bad warnings about whitespace around some operators, + # and later versions don't. So we only run pep8 if it's new + # enough. + if parts >= (1,5,7): + cliapp.runcmd(['pep8', 'obnamlib'], stdout=None, stderr=None) def check_with_pylint(self): cliapp.runcmd( |