Resets PYTHONPATH even when was unset (#56)
This commit is contained in:
Родитель
cd0141e1f0
Коммит
ddaeb0c27e
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
# Inject command to deactivate the environment
|
# Inject command to deactivate the environment
|
||||||
deactivate () {
|
deactivate () {
|
||||||
if [ -n "$_OLD_PATH" ] ; then
|
# Reset PATH, PS1 and PYTHONPATH to their previous state
|
||||||
|
# from before activation
|
||||||
|
if [ "$_OLD_PATH" == "${_OLD_PATH-unset}" ] ; then
|
||||||
PATH="$_OLD_PATH"
|
PATH="$_OLD_PATH"
|
||||||
export PATH
|
export PATH
|
||||||
unset _OLD_PATH
|
unset _OLD_PATH
|
||||||
|
@ -16,13 +18,13 @@ deactivate () {
|
||||||
hash -r
|
hash -r
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$_OLD_PS1" ] ; then
|
if [ "$_OLD_PS1" == "${_OLD_PS1-unset}" ] ; then
|
||||||
PS1="$_OLD_PS1"
|
PS1="$_OLD_PS1"
|
||||||
export PS1
|
export PS1
|
||||||
unset _OLD_PS1
|
unset _OLD_PS1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$_OLD_PYTHONPATH" ] ; then
|
if [ "$_OLD_PYTHONPATH" == "${_OLD_PYTHONPATH-unset}" ] ; then
|
||||||
PYTHONPATH="$_OLD_PYTHONPATH"
|
PYTHONPATH="$_OLD_PYTHONPATH"
|
||||||
export PYTHONPATH
|
export PYTHONPATH
|
||||||
unset _OLD_PYTHONPATH
|
unset _OLD_PYTHONPATH
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
# Inject command to deactivate the environment
|
# Inject command to deactivate the environment
|
||||||
deactivate () {
|
deactivate () {
|
||||||
if [ -n "$_OLD_PATH" ] ; then
|
# Reset PATH, PS1 and PYTHONPATH to their previous state
|
||||||
|
# from before activation
|
||||||
|
if [ "$_OLD_PATH" == "${_OLD_PATH-unset}" ] ; then
|
||||||
PATH="$_OLD_PATH"
|
PATH="$_OLD_PATH"
|
||||||
export PATH
|
export PATH
|
||||||
unset _OLD_PATH
|
unset _OLD_PATH
|
||||||
|
@ -16,13 +18,13 @@ deactivate () {
|
||||||
hash -r
|
hash -r
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$_OLD_PS1" ] ; then
|
if [ "$_OLD_PS1" == "${_OLD_PS1-unset}" ] ; then
|
||||||
PS1="$_OLD_PS1"
|
PS1="$_OLD_PS1"
|
||||||
export PS1
|
export PS1
|
||||||
unset _OLD_PS1
|
unset _OLD_PS1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$_OLD_PYTHONPATH" ] ; then
|
if [ "$_OLD_PYTHONPATH" == "${_OLD_PYTHONPATH-unset}" ] ; then
|
||||||
PYTHONPATH="$_OLD_PYTHONPATH"
|
PYTHONPATH="$_OLD_PYTHONPATH"
|
||||||
export PYTHONPATH
|
export PYTHONPATH
|
||||||
unset _OLD_PYTHONPATH
|
unset _OLD_PYTHONPATH
|
||||||
|
|
Загрузка…
Ссылка в новой задаче