Skip to content

Commit f220b9d

Browse files
committed
Remove try/catch and use next
1 parent 63ac687 commit f220b9d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/pip/_internal/utils/misc.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import sys
1818
from collections import deque
1919

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

546546
def readline(self):
547547
try:
548-
try:
549-
return next(self._gen)
550-
except NameError:
551-
# flake8-bugbear B305 suggests using six.next for
552-
# Python 2 compatibility. This along with the try/except
553-
# block can be removed once we drop Python 2 support
554-
return six.next(self._gen)
548+
return next(self._gen)
555549
except StopIteration:
556550
return ''
557551

0 commit comments

Comments
 (0)