From 050e8d20ea0c3f7af396ab79d5b747dca93823e7 Mon Sep 17 00:00:00 2001 From: Ethan Anderson Date: Tue, 5 Jul 2022 17:07:53 -0500 Subject: [PATCH] Catch OSError to handle gevent monkey patching errors --- git/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/cmd.py b/git/cmd.py index 0d2913678..3dd5aad33 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -546,7 +546,7 @@ def read_all_from_possibly_closed_stream(stream: Union[IO[bytes], None]) -> byte if stream: try: return stderr_b + force_bytes(stream.read()) - except ValueError: + except (OSError, ValueError): return stderr_b or b"" else: return stderr_b or b""