From f035bb9069431e0364a2dfd326e2787297a05cae Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 15 Sep 2022 20:22:46 -0400 Subject: [PATCH] bin/djbdns-logparse.py: localize subprocess imports. --- bin/djbdns-logparse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/djbdns-logparse.py b/bin/djbdns-logparse.py index e6a6759..2a7f6ca 100755 --- a/bin/djbdns-logparse.py +++ b/bin/djbdns-logparse.py @@ -5,7 +5,6 @@ Convert tinydns and dnscache logs to human-readable form import re, typing from struct import pack -from subprocess import Popen, PIPE from time import strftime, gmtime @@ -393,9 +392,10 @@ def parse_logfile(file : typing.TextIO): >>> remove(f.name) """ - # Open pipe to tai64nlocal: we will write lines of our input (the - # raw log file) to it, and read log lines with readable timestamps - # from it. + # Open a pipe to tai64nlocal. We'll write lines of our input file + # (the log file) to it, and read back the same lines but with + # friendly timestamps in them. + from subprocess import Popen, PIPE tai = Popen(["tai64nlocal"], stdin=PIPE, stdout=PIPE, text=True, bufsize=0) for line in file: -- 2.43.2