Explorar o código

Define a stricter return type for _parse_message

If the first item of the tuple is not None, then the second item is
guaranteed not to be None either.
Valentin Lorentz %!s(int64=2) %!d(string=hai) anos
pai
achega
53faf4cc3c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      dulwich/objects.py

+ 1 - 1
dulwich/objects.py

@@ -651,7 +651,7 @@ class Blob(ShaFile):
         return ret
 
 
-def _parse_message(chunks: Iterable[bytes]) -> Iterator[Tuple[Optional[bytes], Optional[bytes]]]:
+def _parse_message(chunks: Iterable[bytes]) -> Iterator[Union[Tuple[None, None], Tuple[Optional[bytes], bytes]]]:
     """Parse a message with a list of fields and a body.
 
     Args: