mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 15:26:23 -04:00
Reject creating a virtualenv named system (yyuu/pyenv#475)
This commit is contained in:
parent
6ac8afbcff
commit
c1b9238cbe
|
|
@ -273,6 +273,11 @@ if [ -z "${VERSION_NAME}" ] || [ -z "${VIRTUALENV_NAME}" ]; then
|
|||
usage 1
|
||||
fi
|
||||
|
||||
if [[ "$VIRTUALENV_NAME" == "system" ]]; then
|
||||
echo "pyenv-virtualenv: \`system' is not allowed as virtualenv name." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$VIRTUALENV_NAME" != "${VIRTUALENV_NAME%[[:space:]]*}" ]; then
|
||||
echo "pyenv-virtualenv: no whitespace allowed in virtualenv name." 1>&2
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -135,3 +135,12 @@ OUT
|
|||
pyenv-virtualenv: no whitespace allowed in virtualenv name.
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "system not allowed as virtualenv name" {
|
||||
run pyenv-virtualenv "3.2.1" "system"
|
||||
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
pyenv-virtualenv: \`system' is not allowed as virtualenv name.
|
||||
OUT
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue