summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Haapala <antti@haapala.name>2016-09-27 10:59:32 +0300
committerBernát Gábor <gaborjbernat@gmail.com>2018-12-16 15:47:21 +0000
commit256d0e116ddccfc2b5f6aff16d43c152d6302fbb (patch)
treed1df5a13648544d0312ace24f9caa23c329825c4
parenta6436ccc17ab347cf61de000498becdefd09e34b (diff)
downloadvirtualenv-256d0e116ddccfc2b5f6aff16d43c152d6302fbb.tar.gz
Allow sourcing activate.sh in shells "exit on error" mode
The newly added `pydoc` unaliasing command ends with exit code 1 if `pydoc` alias is not set; this in turn means that sourcing `activate.sh` in a shell that had been set to exit on first error, upon sourcing that file, will exit on that line. And thanks to suppressing the output of `pydoc` there is no error message being displayed. Simply adding `|| true` should ensure that the command ends successfully.
-rw-r--r--virtualenv_embedded/activate.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/virtualenv_embedded/activate.sh b/virtualenv_embedded/activate.sh
index e7b27f7..47332e8 100644
--- a/virtualenv_embedded/activate.sh
+++ b/virtualenv_embedded/activate.sh
@@ -64,7 +64,7 @@ if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
fi
# Make sure to unalias pydoc if it's already there
-alias pydoc 2>/dev/null >/dev/null && unalias pydoc
+alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
pydoc () {
python -m pydoc "$@"