mirror of
https://github.com/python/cpython
synced 2026-09-29 11:15:30 +03:00
bpo-38771: Explict test for None in code example (GH-17108)
This commit is contained in:
parent
a0ed99bca8
commit
98480cef9d
1 changed files with 1 additions and 1 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue