summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-11 15:55:57 (GMT)
committerT. Wouters <thomas@python.org>2019-09-11 15:55:57 (GMT)
commit63eefc35674ec12ab4d00af4feaf21de4cb1c91c (patch)
tree2f57c6b364d99ce885e880b57bd5701217e4a4a6 /Lib/venv
parent893653357cc83d49049debfeb9074a4ce99cd478 (diff)
downloadcpython-63eefc35674ec12ab4d00af4feaf21de4cb1c91c.zip
cpython-63eefc35674ec12ab4d00af4feaf21de4cb1c91c.tar.gz
cpython-63eefc35674ec12ab4d00af4feaf21de4cb1c91c.tar.bz2
bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15973)
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 ``` (cherry picked from commit 5209e586b7cac9a43b2c44349a26b1b0af06ead3) Co-authored-by: Daniel Abrahamsson <hamsson@gmail.com>
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/scripts/common/activate2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/venv/scripts/common/activate b/Lib/venv/scripts/common/activate
index fff0765..b9d498f 100644
--- a/Lib/venv/scripts/common/activate
+++ b/Lib/venv/scripts/common/activate
@@ -28,7 +28,7 @@ deactivate () {
fi
unset VIRTUAL_ENV
- if [ ! "$1" = "nondestructive" ] ; then
+ if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi