]> granicus.if.org Git - python/commit
bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15973)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Sep 2019 15:55:57 +0000 (08:55 -0700)
committerT. Wouters <thomas@python.org>
Wed, 11 Sep 2019 15:55:57 +0000 (08:55 -0700)
commit63eefc35674ec12ab4d00af4feaf21de4cb1c91c
tree2f57c6b364d99ce885e880b57bd5701217e4a4a6
parent893653357cc83d49049debfeb9074a4ce99cd478
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>
Lib/test/test_venv.py
Lib/venv/scripts/common/activate
Misc/NEWS.d/next/Library/2019-08-19-10-31-41.bpo-37885.4Nc9sp.rst [new file with mode: 0644]