Skip to content

Commit

Permalink
Update type of local_only and user_only to bool
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshks committed May 26, 2020
1 parent 4aa9fcd commit 748a098
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pip/_internal/operations/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
local_only=False, # type: bool
user_only=False, # type: bool
paths=None, # type: Optional[List[str]]
isolated=False, # type: bool
wheel_cache=None, # type: Optional[WheelCache]
Expand All @@ -57,12 +57,12 @@ def freeze(
yield '-f {}'.format(link)
installations = {} # type: Dict[str, FrozenRequirement]

# None is a Falsy value, so pass False if local_only
# and user_only is None
# Cast local_only and user_only to bool to treat
# them as false for None values
for dist in get_installed_distributions(
local_only=local_only if local_only else False,
local_only=local_only,
skip=(),
user_only=user_only if user_only else False,
user_only=user_only,
paths=paths
):
try:
Expand Down

0 comments on commit 748a098

Please sign in to comment.