summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorJonathan Scholbach <j.scholbach@posteo.de>2019-11-12 00:49:41 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-11-12 00:49:41 (GMT)
commit98480cef9dba04794bd61c7e7cca643d384c8c35 (patch)
treef3e81bcdf11d8be9648ea81c1c628eb911b7d44c /Doc/library
parenta0ed99bca8475cbc82e9202aa354faba2a4620f4 (diff)
downloadcpython-98480cef9dba04794bd61c7e7cca643d384c8c35.zip
cpython-98480cef9dba04794bd61c7e7cca643d384c8c35.tar.gz
cpython-98480cef9dba04794bd61c7e7cca643d384c8c35.tar.bz2
bpo-38771: Explict test for None in code example (GH-17108)
Diffstat (limited to 'Doc/library')
-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 90a3f4b..a5e8d04 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'])