diff --git a/run_tests.sh b/run_tests.sh index b2567fee..9a69195b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -89,8 +89,23 @@ function run_pep8 { srcfiles+=" `find tools/*`" srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance" # Just run PEP8 in current environment + # + # NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the + # following reasons: + # + # 1. It's needed to preserve traceback information when re-raising + # exceptions; this is needed b/c Eventlet will clear exceptions when + # switching contexts. + # + # 2. There doesn't appear to be an alternative, "pep8-tool" compatible way of doing this + # in Python 2 (in Python 3 `with_traceback` could be used). + # + # 3. Can find no corroborating evidence that this is deprecated in Python 2 + # other than what the PEP8 tool claims. It is deprecated in Python 3, so, + # perhaps the mistake was thinking that the deprecation applied to Python 2 + # as well. ${wrapper} pep8 --repeat --show-pep8 --show-source \ - --ignore=E202 \ + --ignore=E202,W602 \ --exclude=vcsversion.py ${srcfiles} }