summaryrefslogtreecommitdiff
path: root/Doc/library/collections.rst
diff options
context:
space:
mode:
authorJonathan Scholbach <j.scholbach@posteo.de>2019-11-12 01:49:41 +0100
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-11-11 16:49:41 -0800
commit98480cef9dba04794bd61c7e7cca643d384c8c35 (patch)
treef3e81bcdf11d8be9648ea81c1c628eb911b7d44c /Doc/library/collections.rst
parenta0ed99bca8475cbc82e9202aa354faba2a4620f4 (diff)
downloadcpython-git-98480cef9dba04794bd61c7e7cca643d384c8c35.tar.gz
bpo-38771: Explict test for None in code example (GH-17108)
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r--Doc/library/collections.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 90a3f4bea9..a5e8d04099 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -162,7 +162,7 @@ environment variables which in turn take precedence over default values::
parser.add_argument('-u', '--user')
parser.add_argument('-c', '--color')
namespace = parser.parse_args()
- command_line_args = {k:v for k, v in vars(namespace).items() if v}
+ command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}
combined = ChainMap(command_line_args, os.environ, defaults)
print(combined['color'])