Merge "monkey patch stdlib before importing other modules"

This commit is contained in:
Jenkins 2015-02-11 19:06:50 +00:00 committed by Gerrit Code Review
commit dea4755a30
3 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,11 @@
# under the License.
import gettext
import os
if not os.environ.get('NO_EVENTLET'):
import eventlet
eventlet.monkey_patch()
gettext.install('neutron', unicode=1)

View File

@ -179,7 +179,7 @@ function warn_on_flake8_without_venv {
function run_pep8 {
echo "Running flake8 ..."
warn_on_flake8_without_venv
${wrapper} flake8
NO_EVENTLET=1 ${wrapper} flake8
}
function run_pep8_changed {
@ -192,7 +192,7 @@ function run_pep8_changed {
local files=$(git diff --name-only $target | tr '\n' ' ')
echo "Running flake8 on ${files}"
warn_on_flake8_without_venv
diff -u --from-file /dev/null ${files} | ${wrapper} flake8 --diff
diff -u --from-file /dev/null ${files} | NO_EVENTLET=1 ${wrapper} flake8 --diff
}

View File

@ -49,6 +49,7 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
setenv = NO_EVENTLET=1
commands =
# If it is easier to add a check via a shell script, consider adding it in this file
sh ./tools/misc-sanity-checks.sh