From: Michael Tremer Date: Thu, 1 Feb 2018 14:22:36 +0000 (+0000) Subject: location-query: Use print to print errors, too X-Git-Tag: 0.9.0~68 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=9f2f5d13b1ba7d4649edc72f1ad6b1368a55ebd3 location-query: Use print to print errors, too Signed-off-by: Michael Tremer --- diff --git a/src/python/location-query.in b/src/python/location-query.in index 1f1d42a..1433f1a 100644 --- a/src/python/location-query.in +++ b/src/python/location-query.in @@ -98,7 +98,7 @@ class CLI(object): try: n = self.db.lookup(address) except ValueError: - sys.stderr.write(_("Invalid IP address: %s") % address) + print(_("Invalid IP address: %s") % address, file=sys.stderr) args = { "address" : address, @@ -107,7 +107,7 @@ class CLI(object): # Nothing found? if not n: - print(_("Nothing found for %(address)s") % args) + print(_("Nothing found for %(address)s") % args, file=sys.stderr) ret = 1 continue @@ -138,7 +138,7 @@ class CLI(object): try: asn = int(asn) except ValueError: - sys.stderr.write("Invalid ASN: %s" %asn) + print(_("Invalid ASN: %s") % asn, file=sys.stderr) ret = 1 continue @@ -147,7 +147,7 @@ class CLI(object): # Nothing found if not a: - print(_("Could not find AS%s") % asn) + print(_("Could not find AS%s") % asn, file=sys.stderr) ret = 1 continue