Skip to content

Commit c1c638b

Browse files
committed
Handle updates to flake8
1 parent 04c8dd3 commit c1c638b

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

pip/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
from __future__ import absolute_import
22

3+
import os
34
import sys
45

56
# If we are running from a wheel, add the wheel to sys.path
67
# This allows the usage python pip-*.whl/pip install pip-*.whl
78
if __package__ == '':
8-
import os
99
# __file__ is pip-*.whl/pip/__main__.py
1010
# first dirname call strips of '/__main__.py', second strips off '/pip'
1111
# Resulting path is the name of the wheel itself
1212
# Add that to sys.path so we can import pip
1313
path = os.path.dirname(os.path.dirname(__file__))
1414
sys.path.insert(0, path)
1515

16-
import pip
16+
import pip # noqa
1717

1818
if __name__ == '__main__':
1919
sys.exit(pip.main())

pip/download.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ def _get_hash_from_file(target_file, link):
519519
return download_hash
520520

521521

522+
def _progress_indicator(iterable, *args, **kwargs):
523+
return iterable
524+
525+
522526
def _download_url(resp, link, content_file):
523527
download_hash = None
524528
if link.hash and link.hash_name:
@@ -587,7 +591,7 @@ def resp_read(chunk_size):
587591
break
588592
yield chunk
589593

590-
progress_indicator = lambda x, *a, **k: x
594+
progress_indicator = _progress_indicator
591595

592596
if link.netloc == PyPI.netloc:
593597
url = show_url

pip/utils/__init__.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -397,22 +397,28 @@ def get_installed_distributions(local_only=True,
397397
if local_only:
398398
local_test = dist_is_local
399399
else:
400-
local_test = lambda d: True
400+
def local_test(d):
401+
return True
401402

402403
if include_editables:
403-
editable_test = lambda d: True
404+
def editable_test(d):
405+
return True
404406
else:
405-
editable_test = lambda d: not dist_is_editable(d)
407+
def editable_test(d):
408+
return not dist_is_editable(d)
406409

407410
if editables_only:
408-
editables_only_test = lambda d: dist_is_editable(d)
411+
def editables_only_test(d):
412+
return dist_is_editable(d)
409413
else:
410-
editables_only_test = lambda d: True
414+
def editables_only_test(d):
415+
return True
411416

412417
if user_only:
413418
user_test = dist_in_usersite
414419
else:
415-
user_test = lambda d: True
420+
def user_test(d):
421+
return True
416422

417423
return [d for d in pkg_resources.working_set
418424
if local_test(d)

0 commit comments

Comments
 (0)