]> gitweb.michael.orlitzky.com - djbdns-logparse.git/blobdiff - djbdns/io.py
djbdns/*.py: add module docstrings.
[djbdns-logparse.git] / djbdns / io.py
index 75422c01387032f0a0aab6e87e8f40fac411d010..7af36a0233949b70039a1e76f1f7042607d66d46 100644 (file)
@@ -1,3 +1,7 @@
+r"""
+Functions that perform input/output. This forms a layer between the
+executable itself and the more libraryish modules.
+"""
 from subprocess import Popen, PIPE
 from typing import TextIO
 from djbdns.dnscache import handle_dnscache_log
@@ -37,6 +41,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()