bpo-38771: Explict test for None in code example (GH-17108)

This commit is contained in:
Jonathan Scholbach 2019-11-12 01:49:41 +01:00 committed by Raymond Hettinger
parent a0ed99bca8
commit 98480cef9d
1 changed files with 1 additions and 1 deletions

View File

@ -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'])