Merge pull request #9390 from jdufresne/noqa

Remove unnecessary "noqa" comments
This commit is contained in:
Pradyun Gedam 2020-12-29 09:01:17 +00:00 committed by GitHub
commit af5b7fe1f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 9 deletions

View File

@ -18,7 +18,7 @@ if __package__ == '':
path = os.path.dirname(os.path.dirname(__file__)) path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path) 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__': if __name__ == '__main__':
sys.exit(_main()) sys.exit(_main())

View File

@ -31,7 +31,7 @@ if MYPY_CHECK_RUNNING:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
try: try:
import keyring # noqa import keyring
except ImportError: except ImportError:
keyring = None keyring = None
except Exception as exc: except Exception as exc:

View File

@ -24,7 +24,7 @@ class RequirementSet:
"""Create a RequirementSet. """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.check_supported_wheels = check_supported_wheels
self.unnamed_requirements = [] # type: List[InstallRequirement] self.unnamed_requirements = [] # type: List[InstallRequirement]
@ -69,7 +69,7 @@ class RequirementSet:
parent_req_name=None, # type: Optional[str] parent_req_name=None, # type: Optional[str]
extras_requested=None # type: Optional[Iterable[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. """Add install_req as a requirement to install.
:param parent_req_name: The name of the requirement that needed this :param parent_req_name: The name of the requirement that needed this

View File

@ -45,7 +45,7 @@ if WINDOWS:
# https://bugs.python.org/issue30418 # https://bugs.python.org/issue30418
def _is_broken_pipe_error(exc_class, exc): def _is_broken_pipe_error(exc_class, exc):
"""See the docstring for non-Windows below.""" """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_class is OSError and
exc.errno in (errno.EINVAL, errno.EPIPE))) exc.errno in (errno.EINVAL, errno.EPIPE)))
else: else:
@ -58,7 +58,7 @@ else:
exc_class: an exception class. exc_class: an exception class.
exc: an exception instance. exc: an exception instance.
""" """
return (exc_class is BrokenPipeError) # noqa: F821 return (exc_class is BrokenPipeError)
@contextlib.contextmanager @contextlib.contextmanager

View File

@ -170,9 +170,7 @@ def path_to_display(path):
except UnicodeDecodeError: except UnicodeDecodeError:
# Include the full bytes to make troubleshooting easier, even though # Include the full bytes to make troubleshooting easier, even though
# it may not be very human readable. # it may not be very human readable.
# Silence the "F821 undefined name 'ascii'" flake8 error since display_path = ascii(path)
# ascii() is a built-in.
display_path = ascii(path) # noqa: F821
return display_path return display_path