Skip to content

Commit

Permalink
Merge pull request #9757 from pradyunsg/update-__main__
Browse files Browse the repository at this point in the history
Blacken __main__.py
  • Loading branch information
pradyunsg authored Apr 2, 2021
2 parents ade7220 + 2495cf9 commit 69e85d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ repos:
^src/pip/_internal/req|
^src/pip/_internal/vcs|
^src/pip/_internal/\w+\.py$|
^src/pip/__main__.py$|
^tools/|
# Tests
^tests/conftest.py|
Expand Down
6 changes: 3 additions & 3 deletions src/pip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# of sys.path, if present to avoid using current directory
# in pip commands check, freeze, install, list and show,
# when invoked as python -m pip <command>
if sys.path[0] in ('', os.getcwd()):
if sys.path[0] in ("", os.getcwd()):
sys.path.pop(0)

# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
if __package__ == "":
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off '/pip'
# Resulting path is the name of the wheel itself
Expand All @@ -20,5 +20,5 @@

from pip._internal.cli.main import main as _main

if __name__ == '__main__':
if __name__ == "__main__":
sys.exit(_main())

0 comments on commit 69e85d6

Please sign in to comment.