Skip to content

Commit

Permalink
Merge pull request #9390 from jdufresne/noqa
Browse files Browse the repository at this point in the history
Remove unnecessary "noqa" comments
  • Loading branch information
pradyunsg authored Dec 29, 2020
2 parents 914b7c2 + b78f712 commit af5b7fe
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Empty file.
2 changes: 1 addition & 1 deletion src/pip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)

from pip._internal.cli.main import main as _main # isort:skip # noqa
from pip._internal.cli.main import main as _main

if __name__ == '__main__':
sys.exit(_main())
2 changes: 1 addition & 1 deletion src/pip/_internal/network/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
logger = logging.getLogger(__name__)

try:
import keyring # noqa
import keyring
except ImportError:
keyring = None
except Exception as exc:
Expand Down
4 changes: 2 additions & 2 deletions src/pip/_internal/req/req_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, check_supported_wheels=True):
"""Create a RequirementSet.
"""

self.requirements = OrderedDict() # type: Dict[str, InstallRequirement] # noqa: E501
self.requirements = OrderedDict() # type: Dict[str, InstallRequirement]
self.check_supported_wheels = check_supported_wheels

self.unnamed_requirements = [] # type: List[InstallRequirement]
Expand Down Expand Up @@ -69,7 +69,7 @@ def add_requirement(
parent_req_name=None, # type: Optional[str]
extras_requested=None # type: Optional[Iterable[str]]
):
# type: (...) -> Tuple[List[InstallRequirement], Optional[InstallRequirement]] # noqa: E501
# type: (...) -> Tuple[List[InstallRequirement], Optional[InstallRequirement]]
"""Add install_req as a requirement to install.
:param parent_req_name: The name of the requirement that needed this
Expand Down
4 changes: 2 additions & 2 deletions src/pip/_internal/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BrokenStdoutLoggingError(Exception):
# https://bugs.python.org/issue30418
def _is_broken_pipe_error(exc_class, exc):
"""See the docstring for non-Windows below."""
return ((exc_class is BrokenPipeError) or # noqa: F821
return ((exc_class is BrokenPipeError) or
(exc_class is OSError and
exc.errno in (errno.EINVAL, errno.EPIPE)))
else:
Expand All @@ -58,7 +58,7 @@ def _is_broken_pipe_error(exc_class, exc):
exc_class: an exception class.
exc: an exception instance.
"""
return (exc_class is BrokenPipeError) # noqa: F821
return (exc_class is BrokenPipeError)


@contextlib.contextmanager
Expand Down
4 changes: 1 addition & 3 deletions src/pip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ def path_to_display(path):
except UnicodeDecodeError:
# Include the full bytes to make troubleshooting easier, even though
# it may not be very human readable.
# Silence the "F821 undefined name 'ascii'" flake8 error since
# ascii() is a built-in.
display_path = ascii(path) # noqa: F821
display_path = ascii(path)

return display_path

Expand Down

0 comments on commit af5b7fe

Please sign in to comment.