mercurial/util.py
changeset 49861 ffeeaeb2d142
parent 49814 1d1b244a91b6
child 50684 82cf392c99f6
equal deleted inserted replaced
49860:d5116e4dc744 49861:ffeeaeb2d142
    58     stringutil,
    58     stringutil,
    59 )
    59 )
    60 
    60 
    61 if pycompat.TYPE_CHECKING:
    61 if pycompat.TYPE_CHECKING:
    62     from typing import (
    62     from typing import (
       
    63         Iterable,
    63         Iterator,
    64         Iterator,
    64         List,
    65         List,
    65         Optional,
    66         Optional,
    66         Tuple,
    67         Tuple,
    67     )
    68     )
  2908 def iterfile(fp):
  2909 def iterfile(fp):
  2909     return fp
  2910     return fp
  2910 
  2911 
  2911 
  2912 
  2912 def iterlines(iterator):
  2913 def iterlines(iterator):
  2913     # type: (Iterator[bytes]) -> Iterator[bytes]
  2914     # type: (Iterable[bytes]) -> Iterator[bytes]
  2914     for chunk in iterator:
  2915     for chunk in iterator:
  2915         for line in chunk.splitlines():
  2916         for line in chunk.splitlines():
  2916             yield line
  2917             yield line
  2917 
  2918 
  2918 
  2919