Skip to content

Commit

Permalink
Remove try/catch and use next
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshks committed Jun 6, 2020
1 parent 63ac687 commit f220b9d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/pip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
from collections import deque

from pip._vendor import pkg_resources, six
from pip._vendor import pkg_resources
# NOTE: retrying is not annotated in typeshed as on 2017-07-17, which is
# why we ignore the type on this import.
from pip._vendor.retrying import retry # type: ignore
Expand Down Expand Up @@ -545,13 +545,7 @@ def __init__(self, lines):

def readline(self):
try:
try:
return next(self._gen)
except NameError:
# flake8-bugbear B305 suggests using six.next for
# Python 2 compatibility. This along with the try/except
# block can be removed once we drop Python 2 support
return six.next(self._gen)
return next(self._gen)
except StopIteration:
return ''

Expand Down

0 comments on commit f220b9d

Please sign in to comment.