From: Noel Power Date: Mon, 19 Nov 2018 10:49:40 +0000 (+0000) Subject: script: PY3 port traffic_learner X-Git-Tag: tdb-1.3.17~437 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b920d80ecaeee98c5e562a2c0b384fe8ace635d4;p=thirdparty%2Fsamba.git script: PY3 port traffic_learner Use python3 compatable print Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/script/traffic_learner b/script/traffic_learner index fd5affd609b..1abfdf7b37b 100755 --- a/script/traffic_learner +++ b/script/traffic_learner @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # - +from __future__ import print_function import sys import argparse @@ -37,12 +37,12 @@ def main(): args = parser.parse_args() if not args.out: - print >> sys.stdout, "No output file was specified to write the model to." - print >> sys.stdout, "Please specify a filename using the --out option." + print("No output file was specified to write the model to.", file=sys.stdout) + print("Please specify a filename using the --out option.", file=sys.stdout) return if args.SUMMARY_FILE is sys.stdin: - print >> sys.stderr, "reading from STDIN..." + print("reading from STDIN...", file=sys.stderr) (conversations, interval, @@ -51,7 +51,7 @@ def main(): dns_mode=args.dns_mode) model = traffic.TrafficModel() - print >> sys.stderr, "learning model" + print("learning model", sys.stderr) if args.dns_mode == 'count': model.learn(conversations, dns_counts) else: