From 41eb5d10708c616e95a472d667d061a969f1761c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 14 Sep 2022 20:54:35 -0400 Subject: [PATCH] bin/djbdns-logparse: only import sys.stdin within main(). --- bin/djbdns-logparse | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/djbdns-logparse b/bin/djbdns-logparse index 44514f1..998f547 100755 --- a/bin/djbdns-logparse +++ b/bin/djbdns-logparse @@ -24,7 +24,7 @@ Convert tinydns and dnscache logs to human-readable form # ** http://www.hungry.com/~fn/dnscache-log.pl.txt # -import sys, re +import re from struct import pack from time import strftime, gmtime from subprocess import Popen, PIPE @@ -238,11 +238,12 @@ def main(): # Parse zero or more positional arguments into a list of # "logfiles". If none are given, read from stdin instead. + from sys import stdin parser.add_argument("logfiles", metavar="LOGFILE", type=FileType("r"), nargs="*", - default=[sys.stdin], + default=[stdin], help="djbdns logfile to process (default: stdin)") args = parser.parse_args() -- 2.43.2