summaryrefslogtreecommitdiffstats
path: root/Lib/venv/scripts
diff options
context:
space:
mode:
authorDaniel Abrahamsson <hamsson@gmail.com>2019-09-11 14:58:56 (GMT)
committerT. Wouters <thomas@python.org>2019-09-11 14:58:56 (GMT)
commit5209e586b7cac9a43b2c44349a26b1b0af06ead3 (patch)
treecafe1143250451d37a63d17261fb117308364e50 /Lib/venv/scripts
parent3b58a70d9cf1c0f963adce9b07060116b2775687 (diff)
downloadcpython-5209e586b7cac9a43b2c44349a26b1b0af06ead3.zip
cpython-5209e586b7cac9a43b2c44349a26b1b0af06ead3.tar.gz
cpython-5209e586b7cac9a43b2c44349a26b1b0af06ead3.tar.bz2
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 ```
Diffstat (limited to 'Lib/venv/scripts')
-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 6a2320a..b1b4625 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