bpo-38771: Explict test for None in code example (GH-17108)
This commit is contained in:
parent
a0ed99bca8
commit
98480cef9d
|
@ -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…
Reference in New Issue