Skip to content

Commit cb1c06e

Browse files
miss-islingtonjonathan-scholbach
authored andcommitted
bpo-38771: Explict test for None in code example (GH-17108) (GH-17110)
(cherry picked from commit 98480ce) Co-authored-by: Jonathan Scholbach <[email protected]>
1 parent 917dbe3 commit cb1c06e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ environment variables which in turn take precedence over default values::
162162
parser.add_argument('-u', '--user')
163163
parser.add_argument('-c', '--color')
164164
namespace = parser.parse_args()
165-
command_line_args = {k:v for k, v in vars(namespace).items() if v}
165+
command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}
166166

167167
combined = ChainMap(command_line_args, os.environ, defaults)
168168
print(combined['color'])

0 commit comments

Comments
 (0)