From 3a5a400178399afcbc3051df860231f3c4cf4ff7 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 21 Sep 2022 22:18:18 -0400 Subject: [PATCH] djbdns/io.py: handle nonexistent Popen stdin/stdout. Type annotations say that this is possible, so... just quit if it happens? --- djbdns/io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/djbdns/io.py b/djbdns/io.py index 75422c0..1e41470 100644 --- a/djbdns/io.py +++ b/djbdns/io.py @@ -37,6 +37,9 @@ def parse_logfile(file : TextIO): text=True, bufsize=0) as tai: + if not tai.stdin or not tai.stdout: + return + for line in file: tai.stdin.write(line) line = tai.stdout.readline() -- 2.44.2