mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning: ``` $ python3 -m venv test $ source test/bin/activate (test) $ deactivate -bash: $1: unbound variable ```
This commit is contained in:
parent
3b58a70d9c
commit
5209e586b7
3 changed files with 22 additions and 1 deletions
|
@ -28,7 +28,7 @@ deactivate () {
|
|||
fi
|
||||
|
||||
unset VIRTUAL_ENV
|
||||
if [ ! "$1" = "nondestructive" ] ; then
|
||||
if [ ! "${1:-}" = "nondestructive" ] ; then
|
||||
# Self destruct!
|
||||
unset -f deactivate
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue