Skip to content

Commit

Permalink
remove the virtualenv if it has not been created with proper python
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Tardy committed Jul 7, 2016
1 parent 39d99e1 commit 8fda5fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virtualenvsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def buildCommand(self):
# first, set up the virtualenv if it hasn't already been done, or if it's
# broken (as sometimes happens when a slave's Python is updated)
if ! test -f "$VE/bin/pip" || ! "$VE/bin/python" -c 'import math'; then
if ! test -f "$VE/bin/pip" || ! test -d "$VE/lib/$PYTHON" || ! "$VE/bin/python" -c 'import math'; then
wget {VIRTUALENV_URL}
unzip {VIRTUALENV_FILENAME}
echo "Setting up virtualenv $VE";
rm -rf "$VE";
test -d "$VE" && {{ echo "$VE couldn't be removed"; exit 1; }};
$PYTHON virtualenv.py "$VE" || exit 1;
$PYTHON virtualenv.py -p $PYTHON "$VE" || exit 1;
else
echo "Virtualenv already exists"
fi
Expand Down

0 comments on commit 8fda5fd

Please sign in to comment.