Skip to content

Commit a7c7ff9

Browse files
committed
Python 2/3 compatibiltiy fix
1 parent 7fb6634 commit a7c7ff9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pip/req/req_file.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@ def parse_requirement_options(args):
235235
if opts.global_options:
236236
opts.global_options = flat_shlex_split(opts.global_options)
237237

238-
for opt, value in opts.__dict__.items():
239-
if value is None:
240-
delattr(opts, opt)
238+
# Remove None keys from result.
239+
keys = [opt for opt in opts.__dict__ if getattr(opts, opt) is None]
240+
for key in keys:
241+
delattr(opts, key)
241242

242243
return opts.__dict__
243244

0 commit comments

Comments
 (0)